wx.EVT_COMMAND_RANGE

8 views
Skip to first unread message

Mike Conley

unread,
Nov 27, 2009, 2:43:46 PM11/27/09
to wxpytho...@googlegroups.com
What is the correct way to use EVT_COMMAND_RANGE in wx.Python?

There is a set of radio buttons with ids in array btn_ids[]

        wx.EVT_COMMAND_RANGE(self, self.btn_ids[0], self.btn_ids[-1],
                wx.wxEVT_COMMAND_RADIOBUTTON_SELECTED, self.radio_selected)

sets up the binding correctly, but the code just feels inconsistent with the rest of the app.

is there a way to do

        self.Bind(wx.EVT_COMMAND_RANGE, ??? something ???)

The problem seems to be that I don't know how to feed feed the real command event to Bind().

--
Mike Conley

Robin Dunn

unread,
Nov 30, 2009, 2:59:18 AM11/30/09
to wxpytho...@googlegroups.com
[self.Bind(wx.EVT_RADIOBUTTON, self.OnDoSomething, id=i)
for i in self.btn_ids]

--
Robin Dunn
Software Craftsman
http://wxPython.org

Reply all
Reply to author
Forward
0 new messages