Re: Menu.Append/AppendSubMenu question
"'raf' via wx-users" <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Mar 06, 2025 at 10:37:52AM -0500, Scott Talbert <[email protected]> wrote: > On Thu, 6 Mar 2025, Vadim Zeitlin wrote: > > > On Thu, 6 Mar 2025 13:38:22 +1100 'raf' via wx-users wrote: > > > > r> > r> How do I pass it the Id? I also at some point saw > > r> > r> deprecation warnings for NewId(). > > r> > > > r> > This function is not formally deprecated at C++ level, but it's indeed not > > r> > recommended to use it because it allocates ID from 2 disjoint ranges which > > r> > can be unexpected. wxIdManager::ReserveId() can be used instead. > > r> > > r> The documentation says that NewIdRef() is a replacement. > > r> Is that corredt? > > > > This must be a Python-specific function because there is nothing like this > > in the C++ API, so I don't know, sorry. > > > > In any case, you can continue using NewId() or, alternatively, create a > > menu item with wxID_ANY and then ask for the ID allocated to it. > > wx.NewIdRef() in wxPython basically is a wrapper for calling > wxIdManager::ReserveId() and then keeping that ID "alive" while it is still > referenced in Python: > > https://github.com/wxWidgets/Phoenix/blob/f49f0b446da60f3f5fe88c54fa9c0c171af76681/etg/windowid.py#L99 > > Regards, > Scott Thanks. cheers, raf -- Please read https://www.wxwidgets.org/support/mlhowto.htm before posting. --- You received this message because you are subscribed to the Google Groups "wx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/wx-users/Z8pB9vXEOIwjD23Z%40raf.org.