Forum: wxRuby Notebook page changed event

E50d2ac925f5cf8403197c3cddd11d4b?d=identicon&s=25 Norbert Lange (lange_n)
on 2013-07-17 23:26
I'm having a bit of a problem with the notebook page changed event.  I
would like to have a page change trigger a refresh of data for the page
that is currently selected (the one that's been changed to).

In each of the notebook pages, I've added a panel that has an object
associated with it, and on a page changed event, I'd like each panel to
check if it's currently the one that's visible.  The problem that I'm
finding is that the panel that thinks it's visible is the one that we
just came from, not the one in the panel that we changed to.

Should the evt_notebook_page_changed event fire after we've changed to
the new page and it is visible?

Norbert
E616d8c74827175f975efcbac2ca1ec0?d=identicon&s=25 unknown (Guest)
on 2013-08-02 16:02
(Received via mailing list)
Bonjour,

Je suis actuellement en conges. Je prendrai connaissance de votre
message a partir du 19 aout et vous contacterai des que possible.

Cordialement
E616d8c74827175f975efcbac2ca1ec0?d=identicon&s=25 unknown (Guest)
on 2013-08-02 16:13
(Received via mailing list)
Bonjour,

Je suis actuellement en conges. Je prendrai connaissance de votre
message a partir du 19 aout et vous contacterai des que possible.

Cordialement
89f9acdcbc663e41e45ce590cd746d6e?d=identicon&s=25 Fabio Petrucci (biospank)
on 2013-08-02 17:30
(Received via mailing list)
Hi Norbert,

evt_notebook_page_changed get called after the page has been changed.

To get the current selected page use

evt.selection method (where evt is the event object passed to the
evt_notebook_page_changed)
.
it returns the number of currently selected page (starting from 0)

I use it something like the following:

    def listbook_page_changed(evt)
      begin
        case evt.selection
        when Helpers::ApplicationHelper::ANAGRAFICA_VIEW
          anagrafica_notebook_mgr.current_page().init_panel()
        when Helpers::ApplicationHelper::FATTURAZIONE_VIEW
          fatturazione_notebook_mgr.current_page().init_panel()
        .....
        end

      rescue Exception => e
        logger.error(e.message)
      end

      evt.skip()
    end

hope this help.

Fabio.
E616d8c74827175f975efcbac2ca1ec0?d=identicon&s=25 unknown (Guest)
on 2013-08-02 18:10
(Received via mailing list)
Bonjour,

Je suis actuellement en conges. Je prendrai connaissance de votre
message a partir du 19 aout et vous contacterai des que possible.

Cordialement
This topic is locked and can not be replied to.