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.

21 May 2012

So...

Let's start!

Hi, I'm Marta, I am a OPW intern. I want to write a "0 Beginners Tutorial" for using Gtk+ in Python.

How did I end up here? I wish I knew... no, wait: I know! It was something along the lines of...

No balloon, so far, but a lot of fun!

(This great cartoon was found here! Always give credit where credit's due...)

Thanks to my mentor Tiffany, in the last weeks I have already begun playing with Gtk+ and Python. So far: a Button, a Label and and Image (note to self: next time, do them in reverse order, easier to harder - although label and image have more or less the same difficulty); and a window using MessageDialog and one with a Dialog (note to self: as above - although I understand [but maybe I'm wrong! If so, please tell me in the comments!] that MessageDialog is the "easy" version, writing the Dialog was much easier).

And now: off to do something! There are still a lot of examples that need to be done...