[wxpython-users] All FileDialogs on frame open after single button click

Durand durand1 at gmail.com
Sun Sep 21 03:40:36 PDT 2008


Ahh, that worked great! Thanks a lot Werner!

On Sun, 21 Sep 2008 06:27:37 +0100, Werner F. Bruhin <werner.bruhin at free.fr> wrote:

> Hi,
>
> Durand wrote:
>> Hiya,
>>
>> I'm getting this really, really weird problem where all my Open
>> Dialogs open one after the other even though I only press the button
>> for the first one. I'm new to wxPython but I can't really see where
>> I've gone wrong here...
>>
>> Well, here's the script: http://pastebin.ca/1206796
>>
> You are binding the event to the frame instead of to the individual
> buttons, change the bind to this:
>         self.tremcs_dir_open.Bind(wx.EVT_BUTTON,
> self.OpenTremCS,self.tremcs_dir_open)
>         self.trem_dir_open.Bind(wx.EVT_BUTTON,
> self.OpenTrem,self.trem_dir_open)
>         self.theme_open.Bind(wx.EVT_BUTTON, self.OpenTheme,self.theme_open)
>         self.convert_path_open.Bind(wx.EVT_BUTTON, self.ChooseIM,
> self.convert_path_open)
>         self.graph_live_open.Bind(wx.EVT_BUTTON,
> self.SaveGraphFile,self.graph_live_open)
>
> In the button event handlers you do not need the event.Skip(), also it
> doesn't hurt.
>
> Werner
> _______________________________________________
> wxpython-users mailing list
> wxpython-users at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
> 





More information about the wxpython-users mailing list