Re: C++ button events
Igor Korot <[email protected]> Mon, 1 Jul 2019 12:25:01 -0500
| Newsgroups | gmane.comp.python.wxglade |
|---|---|
| Message-ID | <CA+FnnTwdWsOS4_BpcDgZdg-eSyeFD5i8mKG321N9c6u6eOLjaA@mail.gmail.com> |
Hi, On Mon, Jul 1, 2019 at 12:19 PM Dietmar Schwertberger <[email protected]> wrote: > > On 30.06.2019 15:56, Brendan Simon (eTRIX) wrote: > > 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++ ?? > > Honestly, I don't know as I'm not using C++. I would guess that IDs have > to be defined. E.g. the same was necessary for menu items up to wxGlade > revision 0.7, even for Python. > > Maybe there's a C++ user who can share best practices. Yes, the best way is not to connect with IDs and use wxID_AMY and use Bind() just like in python. However generating the Bind() code in python might be harder. I don't know about python but in C++ you can bind to any object and use "event sink" parameter to set the appropriate handler. Thank you. > > It's probably time to use dynamic event binding instead of tables: > https://docs.wxwidgets.org/3.0/overview_events.html#overview_events_bind > > I will put that on my todo list, but first I need to finish the current > work on merging the ACCESSIBILITY and NEW_CODEGEN branches into master. > I don't know whether this has some negative effects, though. It would be > nice if there was some input from C++ users. > > Regards, > > Dietmar > > > > > _______________________________________________ > wxGlade-general mailing list > wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org > https://lists.sourceforge.net/lists/listinfo/wxglade-general