wx.EVT_COMMAND_RANGE

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

[self.Bind(wx.EVT_RADIOBUTTON, self.OnDoSomething, id=i)
   for i in self.btn_ids]

···

On 11/27/09 11:43 AM, Mike Conley wrote:

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().

--
Robin Dunn
Software Craftsman