Re: C++ button events

"Brendan Simon (eTRIX)" <[email protected]> Sun, 30 Jun 2019 23:56:52 +1000
Newsgroups gmane.comp.python.wxglade
Organization eTRIX pty ltd
Message-ID <[email protected]>
My bad.  I only generated an ID for ONE button, and the others still had
ID_ANY, which meant the first buttons in the event table were still
being processed before it got to the button that had a specific ID.

I still need to manually insert virtual keyword in the wxglade generated
header file so my derived class can override the default event handler
method.

What is the best approach to using buttons in C++ ??

Brendan.

------------------------------------------------------------------------

On 30/6/19 11:51 pm, Brendan Simon (eTRIX) wrote:
> I tried specifying an ID for the button in wxglade.  It generated code
> to specify the button and put it in the event table, but the
> generation event handler still has the event.Skip() code and all the
> other button event handlers get called.  Is this because the event
> handlers aren't virtual in the wxglade generated code?
>
> Thanks, Brendan.
>
> ------------------------------------------------------------------------
>
> On 30/6/19 11:36 pm, Brendan Simon (eTRIX) wrote:
>> Hi,
>>
>> I've got a demo program that needs to be written in C++.  It has 5
>> buttons.
>>
>> If generating Python bindings with wxglade, each button has it's own
>> event handler and only the one event handler gets called.
>>
>> However, the C++ generated code builds a table with wxID_ANY and each
>> event handler has a call to Skip().  So running the built app I get 5
>> lines of output saying it's not implemented (one for each default
>> button handler).
>>
>> Is there a way to make the C++ work more like python code and only
>> call the one method (corresponding to the clicked button)?  I really
>> don't want to maintain window IDs for each button (it seems so
>> unncessary and I don't know how to do that in wxglade - if it's event
>> possible).
>>
>> Also, the C++ code generated does not generate virtual methods. 
>> Shouldn't it generate virtual methods so they can be overridden by a
>> derived class?
>>
>> That's how I design my software with python, and I figured that C++
>> should do the same (well for my way of thinking at least).
>>
>> Thanks, Brendan.
>


-- 
------------------------------------------------------------------------
*eTRIX Services*
PO Box 497, Inverloch, VIC 3996, AUSTRALIA.
(m) 0417-380-984
------------------------------------------------------------------------

_______________________________________________
wxGlade-general mailing list
wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/wxglade-general