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