I’m trying to make a simple Dialog Based GUI using wxWidgets. I am using X11/Xlib.h for image capturing (printscreen). Problems start when I change anything in GUI using wxSmith (e.g. drag and drop new button) because it automatically changes button names to Button1,Button2…
Button1 = new wxButton(this, ID_BUTTON1, _("About"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
Problem is that Button1..5 are already defined in X.h:
/* button names. Used as arguments to GrabButton and as detail in ButtonPress
and ButtonRelease events. Not to be confused with button masks above.
Note that 0 is already defined above as "AnyButton". */
#define Button1 1
#define Button2 2
#define Button3 3
#define Button4 4
#define Button5 5
Can I somehow modify wxWidgets not to automatically change names or just to add my custom prefix e.g. somethingButton1?
Are you changing the var name in the GUI designer, or editing the cpp file directly?
If you edit stuff between
//(*Initialize(PanelName)and//*)in the cpp then any changes you make will be wiped out (not just the change to the button name).If you are looking at the Resources tab (which you should be if you’re using the Drag ‘n Drop), below it is the properties of the currently selected button (or other widget). Change the
Var nameproperty tomyButton1to change the variable name.