wx.aui.auinotebook cancel tab close

Good day all!

Is there a way to catch auinotebook tab close event and cancel it?

I want to perform some tests before page is closed, and depending on test results decide if page closing is allowed.

I have tried to Bind EVT_AUINOTEBOOK_PAGE_CLOSE to event handler.
It seems like this event happens just before page is closed (references to page are still available). However it doesnot matters if there is or there is not event.Skip() inside handler, page in both cases is closed.

Also I have tried EVT_AUINOTEBOOK_PAGE_CHANGED. It happens after page is closed (references to page causes error).

Working on windows xp, python2.5, wxpython 2.8.9.1.

Thanks,
Aigars

Sorry for misstyping - EVT_AUINOTEBOOK_PAGE_CLOSED is the event when references to page are not anymore available.

Aigars

Quoting Aigars Aigars srad@inbox.lv:

···

Good day all!

Is there a way to catch auinotebook tab close event and cancel it?

I want to perform some tests before page is closed, and depending on test results decide if page closing is allowed.

I have tried to Bind EVT_AUINOTEBOOK_PAGE_CLOSE to event handler.
It seems like this event happens just before page is closed (references to page are still available). However it doesnot matters if there is or there is not event.Skip() inside handler, page in both cases is closed.

Also I have tried EVT_AUINOTEBOOK_PAGE_CHANGED. It happens after page is closed (references to page causes error).

Working on windows xp, python2.5, wxpython 2.8.9.1.

Thanks,
Aigars

Aigars Aigars wrote:

Sorry for misstyping - EVT_AUINOTEBOOK_PAGE_CLOSED is the event when references to page are not anymore available.

Aigars

Quoting *Aigars Aigars <srad@inbox.lv <mailto:srad@inbox.lv>>*:

    Good day all!

    Is there a way to catch auinotebook tab close event and cancel it?

    I want to perform some tests before page is closed, and depending on
    test results decide if page closing is allowed.

    I have tried to Bind EVT_AUINOTEBOOK_PAGE_CLOSE to event handler.
    It seems like this event happens just before page is closed
    (references to page are still available). However it doesnot matters
    if there is or there is not event.Skip() inside handler, page in
    both cases is closed.

Try calling event.Veto() in the event handler.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks, it works.

Aigars

Quoting Robin Dunn robin@alldunn.com:

···

Aigars Aigars wrote:

Sorry for misstyping - EVT_AUINOTEBOOK_PAGE_CLOSED is the event when
references to page are not anymore available.

Aigars

Quoting Aigars Aigars <srad@inbox.lv mailto:srad@inbox.lv>:

Good day all!

Is there a way to catch auinotebook tab close event and cancel it?

I want to perform some tests before page is closed, and depending on
test results decide if page closing is allowed.

I have tried to Bind EVT_AUINOTEBOOK_PAGE_CLOSE to event handler.
It seems like this event happens just before page is closed
(references to page are still available). However it doesnot matters
if there is or there is not event.Skip() inside handler, page in
both cases is closed.

Try calling event.Veto() in the event handler.


Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!


wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users