python - How to bring the value of "val" to the bottom? -
the following code , want bring variable "val" bottom, how can it?
#!/usr/bin/env python import gtk class scalebutton: def __init__(self): window = gtk.window() window.set_default_size(100, 100) scalebutton = gtk.scalebutton(gtk.icon_size_menu, float(0), float(2.5), float(0.025), (gtk.stock_zoom_fit, gtk.stock_zoom_fit)) scalebutton.set_value(float(0.4)) val = scalebutton.get_value()
the variable "val has printed in bottom
window.connect("destroy", lambda w: gtk.main_quit()) scalebutton.connect("value-changed", self.value_changed) window.add(scalebutton) window.show_all() def value_changed(self, scalebutton, value): valu = scalebutton.get_value() print valu print val
is there way print these 2 variables in single
scalebutton() gtk.main()
you set variable val global. global val
you'd have set @ beginning , call global everywhere wanted use value.
Comments
Post a Comment