Sorry, i forget this
2007/6/28, JUAN JOSE ROJO <[EMAIL PROTECTED]>:
2007/6/27, James Dietrich <[EMAIL PROTECTED]>:
>
> Hi,
>
> In the following program, one click on the spinbutton will
> advance the number displayed by two digits--from '1' to '3'.
> Apparently the 'value-changed' signal gets emitted twice
> when the adj_callback takes some time to do. If I uncomment
> the line with 'return' on it so that it skips the long loop, one
> click advances the number on the spinbutton by one
> number, as expected.
>
> Am I missing something about how spinbuttons work?
>
> Thanks for your help,
> James Dietrich
>
> import gtk
>
> def adj_callback(adj):
> print "Adj Callback"
> #return
> for x in range(10000000): y = x * x
>
> win = gtk.Window()
> win.connect('delete-event', gtk.main_quit)
>
> adj = gtk.Adjustment(1, 1, 100, 1, 1, 0)
adj = gtk.Adjustment(1, 1, 100, 2, 1, 0)
With that should work jumping two digits.
spin = gtk.SpinButton(adj, 0, 0)
> spin.connect('value-changed', adj_callback)
spin.connect('change-value', adj_callback)
spin.show()
>
> win.add(spin)
> win.show()
>
> gtk.main()
> _______________________________________________
> pygtk mailing list [email protected]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
>
_______________________________________________
pygtk mailing list [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/