[Tutor] sending data between classes

Alan Gauld alan.gauld at btinternet.com
Wed May 23 00:26:12 CEST 2007


"Antonio Diaz" <minyie at hotmail.com> wrote in message 
news:BAY144-W1848572F28691C44257747D0360 at phx.gbl...
oh ok :)but how do i manage to use a variable on one class in another? 
exclass main () :.....def on_rotate_activate(self, widget, *args): 
window_rotate=edit_rotate()        print 
window_rotate.value......class edit_rotate(wndBase):    def 
my_response(self, widget, respuesta):        if respuesta == 
gtk.RESPONSE_OK:            #print 
self.wTree.get_widget("entry_rotate").get_text() 
value=int(self.wTree.get_widget("entry_rotate").get_text() 
else:            widget.destroy()that doesnt work for me :S  i want to 
show the value of "value" in the main class

So create a showValue method in main that has a widget as
a parameter and displays the value on that widget. If value is
an attribite of main then its mains responsibility to display it.

Or if main is a model class then create a view that pairs with
it to display the attribute. But its not clear what your objects
are - they look more like functions.

Alan G. 




More information about the Tutor mailing list