gtk - Python : Returning a pyGTK object for packing -


how pass gtk object among classes , functions ?

i have gui class, gtkwindow, , have player class, vbox play button , slider, , gst pipeline playbin.

(pseudo-code)

class player(object):     def __init__(self):         self.play_button = gtk.button()         self.slider = gtk.hscale()          self.hbox = gtk.hbox()         self.hbox.pack_start(self.play_button, false)         self.hbox.pack_start(self.slider, true, true)         def getbox():             return self.hbox  class gui:     def __init__(self, dname = none):         player = player()         playerbox = playerbox.getbox         vbox = gtk.vbox()         vbox.pack_start (playerbox, false, false, 1) 

but

typeerror: gtk.box.pack_start() argument 1 must gtk.widget, not instancemethod 

maybe it's not right way it, , boxes must live in same class everytime..?

you neglected call getbox method. instead of playerbox = player.getbox, need write playerbox = player.getbox(). writing former extracts function object itself, why pack_start complains receiving instancemethod argument 1.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -