wxauinotebook get page to be closed
BlitzMax Forums/Brucey's Modules/wxauinotebook get page to be closed
| ||
Hi, I wasn't able to find something via google so I hope someone has an idea here. The thing is that my wxauinotebook has close buttons on every page. I connect towxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE. It works so far. But how am I able to get the page to be closed from the event??? I tried every getter of the wxCommandEvent and none of 'em have any information about it. And the notebook itself neither. I need this to ask the typical "are you sure you don't want to save before closing?" and to kill some references if the window is closed. I used the current selected window of the notebook for that but because I added wxAUI_NB_CLOSE_ON_ALL_TABS this is not effective anymore. |
| ||
It should probably raise a wxAuiNotebookEvent, rather than a wxCommandEvent. Looks like a recent class that wasn't in the original implementation. |
| ||
I've added wxAuiNotebookEvent now. From there, you should be able to query the event GetSelection(), which will return the index of the page to be closed. |
| ||
Can't cast event emitted by wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE to wxAuiNotebookEvent. |
| ||
Oh? I committed wxaui.mod changes, so it should work as expected. You will need to update your wx.mod, of course :-) |
| ||
Sure I did. (and I rebuild the module as well ^^) But the event is derived from a wxCommandEvent. You can check it with the aui example. |
| ||
Oh yes, you are correct. Problem fixed, and apologies! |
| ||
works now. thx |