Python Forum
[WxPython] TypeError: request for something already fulfilled?
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[WxPython] TypeError: request for something already fulfilled?
#2
In the first example, a wx panel's init method is called
class tiropanel(wx.lib.scrolledpanel.ScrolledPanel):
    def __init__(self, parent, id):
        wx.Panel.__init__(self, parent, id)
it should be a scrolledpanel's init method that's called
class tiropanel(wx.lib.scrolledpanel.ScrolledPanel):
    def __init__(self, parent, id):
        wx.lib.scrolledpanel.ScrolledPanel.__init__(self, parent, id)
and when calling setupscrolling don't pass self, the first parameter is scroll_x which is a Boolean True to allow horizontal scrolling, False otherwise.
self.SetupScrolling(self)
if you don't want to pass any arguments don't pass anything
self.SetupScrolling()

In the second example the same init error occurs
class tiropanel(wx.lib.scrolledpanel.ScrolledPanel):
    def __init__(self, parent, id):
        wx.Panel.__init__(self, parent, id)
should be
class tiropanel(wx.lib.scrolledpanel.ScrolledPanel):
   def __init__(self, parent, id):
       wx.lib.scrolledpanel.ScrolledPanel.__init__(self, parent, id)
There is also an error in the linkspanel class
hbox.Add(tiropanel, 0, wx.EXPAND)
should be
hbox.Add(self.tiropanel, 0, wx.EXPAND)
as you had not capitolized the tiropanel class its trying to add that instead.


Note I generally use super instead for calling baseclass init method
class Tiropanel(wx.lib.scrolledpanel.ScrolledPanel):
   def __init__(self, parent, id):
        wx.lib.scrolledpanel.ScrolledPanel.__init__(self, parent, id)
can be replaced with
class Tiropanel(wx.lib.scrolledpanel.ScrolledPanel):
   def __init__(self, parent, id):
       super(Tiropanel, self).__init__(parent, id)
Reply


Messages In This Thread
RE: TypeError: request for something already fulfilled? - by Yoriz - Dec-23-2016, 02:06 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020