Menu.Append/AppendSubMenu question
"'raf' via wx-users" <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, I've just started converting a python-2.7/wxpython-2.8.12.1 app to python-3.12/wxpython-4.2.2. The first API change that I've run into is Menu.Append(). It looks like it used to have parameters: id, text, help (at least they were the ones I used - there are others). And the names have changed to: id, item, helpString. That's fine. but when I look at: https://docs.wxpython.org/wx.Menu.html#wx.Menu.Append It says: Deprecated This function is deprecated, use AppendSubMenu instead. AppendSubMenu seems like a unfortunate name for a function that adds a menuitem with no submenu, but I assume I can just pass it submenu=None and that'll be OK (although the docs are very brief and don't state whether this will be OK or not) But more importantly, AppendSubMenu doesn't take an id parameter. How do I pass it the Id? I also at some point saw deprecation warnings for NewId(). And looking into it, it seems that I need to replace all my uses of NewId() with NewIdRef(), but if I have to use AppendSubMenu(), which doesn't accept an id parameter, what am I supposed to do? I do reuse ids when the same functionality appears in multiple places within the menu. Thanks for any advice you might have. 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/Z8fRdHoVyj0oGRC6%40raf.org.