wxWidget 2.9.5 (3.0?) Macro alternatives Topic is solved

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
exiled
In need of some credit
In need of some credit
Posts: 3
Joined: Mon Jan 21, 2013 3:30 pm

wxWidget 2.9.5 (3.0?) Macro alternatives

Post by exiled » Mon Jan 21, 2013 3:49 pm

I read somewhere that the newest version of widgets has made strives to get away from from macros but I was wondering if there is a change log somewhere showing what exactly has been changed. I am looking at both wxWidgets and gtkmm and I have to say I don't really like the fact you have to assign widgets a magical number to identify it. I'm not sure if this has changed since the macro event table and the Connect() method. I mentioned gtkmm because it's interface is really nice and doesn't rely on magic numbers for specifying the type of event and who's event it should be (it seems wxWidget really followed in the step of windows here...). The only problem with gtkmm is that only version 2.2 is being maintained on windows and it has a list of dependencies a mile long which each have their own unique compilation process if I wanted to use the most recent version 3.6 .

DavidHart
Site Admin
Site Admin
Posts: 3980
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: wxWidget 2.9.5 (3.0?) Macro alternatives

Post by DavidHart » Mon Jan 21, 2013 5:21 pm

Hi,
I was wondering if there is a change log somewhere showing what exactly has been changed
There's Changes Since wxWidgets 2.8 and docs/changes.txt, but I don't think there's one specific to what (I believe) you're asking.
I don't really like the fact you have to assign widgets a magical number to identify it.
Which magic number do you mean? Every control has an integer ID, which you can either assign and use yourself, let wx set and you use, or ignore all together.
I'm not sure if this has changed since the macro event table and the Connect() method.
I'm not sure I understand the connection (no pun intended).

If you use wxEvtHandler::Connect or the new, improved wxEvtHandler::Bind, you don't need static event tables or their contained macros. There are lots of other macros used inside wxWidgets, and a few that are intended for use by the programmer e.g. IMPLEMENT_APP(), but nothing particularly scary.

I hope this answer isn't too orthogonal to what you want to know ;) .

Regards,

David

Post Reply