How do I catch a closing event for a Notebook page. I have added a number of pages (class Panel) to a Notebook and I can remove them via the default close button on the pane. But I what to run some code before the page(Panel) is closed, so I assumed that it gets a ''evt_close'', but that seems not to be the case. How do I get to run some code before the page(Panel) closes?
Svend Haugaard S?rensen wrote:> I have added a number of pages (class Panel) to a Notebook and I > can remove them via the default close button on the pane. > But I what to run some code before the page(Panel) is closed, > so I assumed that it gets a ''evt_close'', but that seems not to be > the case. > > How do I get to run some code before the page(Panel) closes?As far as I know, individual pages within the standard Wx::Notebook can''t be closed via the user interface, only programmatically. There aren''t individual ''close'' buttons on each pane for the user to do this. If you''re using Wx::AuiNotebook for this, which does have IDE-like tabs with their own close buttons, then there is an event specifically for this, something like evt_auibook_page_closing - have a look at the aui sample to check the name. a
Svend Haugaard Sørensen
2009-Dec-15 03:28 UTC
[wxruby-users] Closing event on a Notebook page.
On Mon, 14 Dec 2009 21:02:05 +0000 Alex Fenton <alex at pressure.to> wrote:> Svend Haugaard S?rensen wrote: > > I have added a number of pages (class Panel) to a Notebook and I > > can remove them via the default close button on the pane. > > But I what to run some code before the page(Panel) is closed, > > so I assumed that it gets a ''evt_close'', but that seems not to be > > the case. > > > > How do I get to run some code before the page(Panel) closes? > > As far as I know, individual pages within the standard Wx::Notebook > can''t be closed via the user interface, only programmatically. There > aren''t individual ''close'' buttons on each pane for the user to do > this. > > If you''re using Wx::AuiNotebook for this, which does have IDE-like > tabs with their own close buttons, then there is an event > specifically for this, something like evt_auibook_page_closing - have > a look at the aui sample to check the name.Ahh, I didn''t know the where 2 different NoteBooks classes, that explain my problems. Thanks for the help.