problem with stock button ids

Christian Meesters meesters at uni-mainz.de
Mon Sep 4 00:30:35 PDT 2006


Hi,

wanted to make use of stock buttons in a self-made dialog. The code looks like 
this:
class MetaDataDialog(wx.Dialog):
    def __init__(self, *args, **cmds):
<snip>
	self.b = wx.Button(self,wx.ID_SAVE)
        wx.EVT_BUTTON(self,self.b.GetId(),self.PutValue)
        self.b.SetDefault()

Now I'd like to access the ID in a function of the parent frame:

	mdatadialog = MetaDataDialog(self,title="Manipulating Meta Data")
	if mdatadialog.ShowModal() == wx.ID_SAVE:
	
Clicking on the 'SAVE' button does close the dialog, as programmed in the the 
function 'PutValue', but I never get mdatadialog.ShowModal() == wx.ID_SAVE to 
be true. Can anybody point me on my mistake, please?

TIA
Christian




More information about the wxpython-users mailing list