Will successive calls of wxNewId() return successive IDs?
Volker Bartheld
dr_versaeg at freenet.de
Tue Jan 30 13:06:58 PST 2007
Hi!
I'm using wxNewId() to assign IDs for controls. Is it guaranteed that
const int ID_1 = wxNewId();
const int ID_2 = wxNewId();
const int ID_3 = wxNewId();
const int ID_4 = wxNewId();
return successive IDs to be used i. e. in
EVT_MENU_RANGE(ID_1, ID_4, MyDialog::OnMenuRange)
?
By looking at the wxMSW source
<src/common/utilscmn.cpp>
// Id generation
static long wxCurrentId = 100;
long wxNewId()
{
// skip the part of IDs space that contains hard-coded values:
if (wxCurrentId == wxID_LOWEST)
wxCurrentId = wxID_HIGHEST + 1;
return wxCurrentId++;
}
</utilscmn.cpp>
this seems to be the case - but can I be sure for wxLIN and wxMAC?
THX.
Volker
__
Mail replies to/an V B A R T H E L D at G M X dot D E
More information about the wx-users
mailing list