Dear all,
my App's GUI is internationalized. Choices (MenuItem objects) are dynamically created based on a config setting, in a for loop. The following lines are inside this loop, used to create the ID and assign it a value.
idname = 'ID_LanguageMenu_{}'.format(localename)
globals()[idname] = wx.NewId()
.
.
.
self.Bind(wx.EVT_MENU, lambda event, args=(localename,): self.OnLanguageChange(event, *args), id=globals()[idname])
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/8778d054-3eb2-4f5f-9eca-fb5f32a00bb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,According to the documentation, wx.ID_ANY is used in situations where you don't care what the ID is.Turns out that wx.NewID is now depricated, and I've been using wx.NewIdRef().GetId() to great affect.
--Robin
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/dd0eb2e2-d437-41d9-9b85-65e4863ddacc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CANjhqb8qOe0NwkOg4%2BGdkDxTo%2BXyUm2oVAeBH1%2BO9dnU_Ztbwg%40mail.gmail.com.
Mr. Dunn, Mr. Norman,The error is obviously on my sinde for not reading and thinking, but doing.I'll check the migration page - I've never seen it before.Thank you both for the advice.All the best,Gábor
On Mon, May 20, 2019 at 6:22 PM 'Chris Norman' via wxPython-users <wxpytho...@googlegroups.com> wrote:
On Mon, 20 May 2019 at 17:03, Robin Dunn <ro...@alldunn.com> wrote:On Saturday, May 18, 2019 at 4:04:36 PM UTC-7, Chris Norman wrote:Hi,According to the documentation, wx.ID_ANY is used in situations where you don't care what the ID is.Turns out that wx.NewID is now depricated, and I've been using wx.NewIdRef().GetId() to great affect.The last item in the MigrationGuide gives some more details: https://docs.wxpython.org/MigrationGuide.html#wx-newid-is-deprecatedThat's great, I'd forgotten about that page, thank you so much.
----Robin
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpytho...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/dd0eb2e2-d437-41d9-9b85-65e4863ddacc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--Take care,Chris Norman
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpytho...@googlegroups.com.