If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
I want to create an object that when created it has its own unique wxID. I saw in older posts that you can use wxNewId(); but it has been deprecated? Is there any way I could generate them at runtime?
What kind of object are you trying to create? If it's a wxWidgets class that takes an ID, use wxID_ANY. Then you can get the actual id that was assigned afterwards, e.g. with wxWindow::GetId().
If it's for another custom object, you could use ::wxNewId().
doublemax wrote: ↑Fri Aug 16, 2019 11:06 pm
What kind of object are you trying to create? If it's a wxWidgets class that takes an ID, use wxID_ANY. Then you can get the actual id that was assigned afterwards, e.g. with wxWindow::GetId().
If it's for another custom object, you could use ::wxNewId().
I'm creating a custom object with these parameters so I'm assuming I could use wxID_ANY and then create a method to access its id correct?
singlesliderobj::singlesliderobj(wxPanel *parent,
wxWindowID id,
int mainValue, int minValue, int maxValue,
const wxPoint& pos,
const wxSize& size,
long style)
also, i was looking through custom examples on the wxwidgets tutorial and they made id a type int. What's the difference if its type wxWindow and type int?
bandali99 wrote: ↑Sat Aug 17, 2019 6:59 pm
also, i was looking through custom examples on the wxwidgets tutorial and they made id a type int. What's the difference if its type wxWindow and type int?