26 May 2012

New examples (they know where their towel is).

Yesterday I managed to write the example of a GtkScale and the one of a GtkSpinbutton.

Yesterday was Towel Day.

Guess at which value the screenshot showed them?

SpinButton...
...and Scales!
(Both examples also use a Statusbar.)
(On a more serious note, a lesson from yesterday: if the interpreter does not return any error but something is wrong, always check if you're using the constructor in the correct way. For instance I tried for 3 hours to write the GtkScale as
scale = Gtk.Scale() 
scale.new_with_range(Gtk.Orientation.HORIZONTAL, 0, 100, 5)
and variations on the theme, only to get a scale - without a handle! I had to do a
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=some_adjustment)
to get the desired result...)

Update: Now the examples use a label. Simpler, more elegant.