On Thu, Nov 21, 2013 at 11:32 AM, Andreas Falkenhahn <andr...@falkenhahn.com
> wrote:
> Hi,
>
> in wxWidgets I can do the following:
>
> BEGIN_EVENT_TABLE(RadioWidgetsPage, WidgetsPage)
> EVT_RADIOBOX(RadioPage_Radio, RadioWidgetsPage::OnRadioBox)
> EVT_RADIOBOX(wxID_ANY, RadioWidgetsPage::OnRadioBox2)
> END_EVENT_TABLE()
>
> OnRadioBox() should be called when the wxRadioBox that has the id
> RadioPage_Radio
> is clicked, otherwise OnRadioBox2 should be called. In wxLua this looks
> like this:
>
>
I would have assumed that OnRadioBox2 would be called for ALL events of ANY
id.
> this:Connect(RadioPage_Radio, wx.wxEVT_COMMAND_RADIOBOX_SELECTED,
> OnRadioBox)
> this:Connect(wx.wxID_ANY, wx.wxEVT_COMMAND_RADIOBOX_SELECTED, OnRadioBox2)
>
> However, the use of wxID_ANY seems to confuse wxLua here because even if
> the
> user clicks the wxRadioBox that has the id RadioPage_Radio wxLua will still
> run the OnRadioBox2() callback. Is that a bug or some kind of limitation?
>
>
This would be the expected behavior, I think. You are installing TWO
callback handlers so both are called if their patterns match.
I would guess that the difference is that maybe you are calling
event.Skip(true/false) or not at all in the two different programs. Note
that not calling event.Skip() is the same as calling event.Skip(false) and
that skipping the event means that the event is propagated to the next
matching handler (if one exists).
For simplicity, if you need the wxID_ANY I would only have that one handler
and use a "case" style statement to route the event to any specialized
handler.
Regards,
John
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing
conversations that shape the rapidly evolving mobile landscape. Sign up now.
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users