Hi John,

On 21.11.2013 at 19:38 John Labenski wrote:

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

Ok, this has turned out to be wxWidgets peculiarity. Consider the following
event table:

BEGIN_EVENT_TABLE(MyFrame, wxFrame)     
    EVT_RADIOBOX(RadioPage_Radio, MyFrame::OnRadioBox)          
    EVT_RADIOBOX(wxID_ANY, MyFrame::OnCheckOrRadioBox)  
END_EVENT_TABLE()

To convert this event table into a sequence of Connect() calls, you
have to invert the order, i.e.:

Connect(wxID_ANY, wxEVT_COMMAND_RADIOBOX_SELECTED, 
wxCommandEventHandler(MyFrame::OnCheckOrRadioBox)); 
Connect(RadioPage_Radio, wxEVT_COMMAND_RADIOBOX_SELECTED, 
wxCommandEventHandler(MyFrame::OnRadioBox));  

This is because Connect() adds new events at the *beginning* of the
event handler list. I didn't know that and used the order of the
event table when converting it to a series of Connect() calls which
led to the general handler getting called first.

-- 
Best regards,
 Andreas Falkenhahn                            mailto:andr...@falkenhahn.com


------------------------------------------------------------------------------
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

Reply via email to