Użytkownik Jacek Kałucki napisał:
> Hi,
>
> Is it the feature or bug that object based on dStandardButtonDialog class
> did't handle __onDestroy event of its child controls?
>
I seems problem is not related with dStandardButtonDialog class but with
application main loop.
Sample code:
<code>
import dabo
dabo.ui.loadUI("wx")
#Dialog class
class dtc(dabo.ui.dOkCancelDialog):
def afterInit(self):
self.txtTest = dabo.ui.dTextBox(self)
#Main form class
class FrmMain(dabo.ui.dFormMain):
def afterSetMenuBar(self):
menuBar = self.MenuBar
if menuBar:
menuBar.appendMenu(MenTest(self, MenuID="app_test",
Caption=u"Test"))
#Menu class
class MenTest(dabo.ui.dMenu):
def afterInit(self):
app = self.Application
self.append(u"Test", OnHit=self.openDialog)
def openDialog(self, evt):
ShowDialog()
#Dialog creation function
def ShowDialog():
form = dtc(None)
form.show()
return form.Accepted
#Main
app = dabo.dApp(MainFormClass=None)
app.setup()
if ShowDialog():
app.MainForm = dabo.ui.dFormMain(None)
app.start()
</code>
Test: I put breakpoints in dtc.txtTest.__onDestroy() and dtc.close()
methods.
Then when I choose "Cancel" in dialog, breakpoints are never reached.
Is this correct behavior or not?
Next, when I choose "Ok", breakpoints aren't reached until I close main
form.
It happens if I start dialog from menu too.
Does modal form need to be explicit released by calling form.release()?
I found a kind of comment about it in demo/samples/Minesweeper.py example.
--
Regards
Jacek Kałucki
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]