From: Mattia B. <mb...@ds...> - 2002-09-05 20:52:43
|
> -----Original Message----- > From: Mattia Barbon [mailto:mb...@ds...] > Sent: Thursday, September 05, 2002 9:32 AM > To: Everett, Toby > Cc: wxp...@li... > Subject: RE: [wxperl-users] Minor inconsistency using MenuItem and > EVT_MEN U > > > Ah, OK, I didn't understand you were talking about wxMenuItem (I somehow > missed > > the second half of the subject - sorry). > > The answers are that passing -1 to the menuitem ctor is not going to work > - > > unfortunatley - it is a wxWindows feature (or limitation, depending on > your POV). > > The other problem (having to call ->GetId on the menuitem) will be fixed > in the > > next wxPerl release. > Am I correct in guessing that the otherwise undefined value ID_SEPARATOR is > actually -1? Interestingly, when Microsoft uses ID_SEPARATOR in MFC, it Yes > uses 0 (see VC98\MFC\Include\AFXRES.H). > > Is there a reliable way of querying wxWindows for an unused id? One way of > doing it would be to increment starting at wxID_HIGHEST and to use > FindWindow to ensure that there isn't already something using the id (just > in case one of the randomly assigned ids happens to conflict). wxNewId and wxRegisterId appear to do what you want. Unfortunately they are not wrapped (yet). Will be in the next release. Until then your method looks like the only alternative. Regards Mattia |