What’s ‘Veto’ method…? I am new to wxPython.
Here is the code:
def OnPageClosing(self, event=None):
page = self._notebook.GetPageText(event.GetSelection())
if page == ‘myPage’:
return #don’t close
It’s not working.
···
----- Original Message ----
From: Robin Dunn robin@alldunn.com
To: wxpython-users@lists.wxwidgets.org
Sent: Friday, June 20, 2008 10:07:17 PM
Subject: Re: [wxpython-users] FlatNotebook - condition based page closing using ‘x’ button
Prashant Saxena wrote:
Hi,
have bind the ‘FlatNoteBook’ with ‘EVT_FLATNOTEBOOK_PAGE_CLOSING’ event.
When closing a page using ‘x’ button this event is getting called
properly. Inside the event
definition, based on a condition I am not able to cancel the closing
operation.For example inside the ‘‘EVT_FLATNOTEBOOK_PAGE_CLOSING’’ function:
if page name is ‘abs’ then close it
else don’t.Is there any other event for this task or …?
Call the event object’s Veto method if you want to prevent the page from
closing.
–
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