29 September 2012

Long time...

...no blog.

Sorry. I was taking a holiday (it went very well), then trying to resuscitate my Java (it's feeling a bit better, I should learn to use github well and put what I did there soon), then seeing a lot of doctors (nothing serious, just many little nuisances that amounted to a lot of time wasted).

Now I have enrolled in Christian Hergert's C class. I can't wait for the fun to start... I cannot thank Christian enough for his dedication to this (huge) endeavour. And my first mentor (a long story, one that tells how I really got into programming in the first place) tells me that I should give Go a try - and I want to.

Last but not least, my PhD has started again. The notorious Scarf's Lemma has resurfaced again, and so has the PPAD complexity class. Fingers crossed...

[Fun, totally uncorrelated, fact: I looked for Scarf's Lemma on Wikipedia, and I found a picture of Scarf. And he looks a lot like François Truffaut - don't you think?]

21 August 2012

So, how did it go?

The ButtonBox had some problems. Namely: it was a calculator... that did not work! At least, not if you tried to do something along the lines of "2 + 3 - 1".

I spent half a day re-writing the methods for calculating things, remembering my reverse Polish notation - and now it works, at least as long as you don't require that multiplication has precedence over sum.

Anyway, then it was time for the MenuButton (with some help to use jhbuild) and the Tooltip.

The first one was done on the model of what was already done in Vala. As I said at GUADEC, reading Vala knowing a bit of Java is like reading Spanish knowing Italian: you meet a lot of false friends, but you end up getting the general meaning. So, Vala examples has been my reference for all the internship.

The Tooltip was done just adding some tooltips to the old Toolbar code. Simple, and there is already room for an exercise (I added the tooltips to 3 buttons out of 4 - who will complete the job? No-one but you, my dear reader!)

Unfortunately, due to a couple of constraints (time and being a bit under the weather) my work has stopped here. I plan to start again as soon as possible, to write that "custom widget" and to revise all the pages of tutorial (should the "API Reference" section point to the stable or to the unstable version? What do you think?).

So: how did it go?

How did the internship go? Are you really asking that?


I have learned a lot (I much more proficient in Python, I have learned how to do at least the basic stuff with Gtk+, I have managed to get along with git...), I am much more confident about my skills (in programming in particular and in "keeping a job" in general), and my ability to learn something new quickly.

So: when do we start doing something new again?

Soon, I think... Watch this space!

Last but not least: another HUGE thank you to Marina, for organizing the Outreach Program for Women and to Tiffany, for being such an extraordinary mentor... thank you, really, from the bottom of my heart.

16 August 2012

Near the end, a cliffhanger.

(As in every half-decent movie!)

The time of my internship in the Outreach Program for Women is almost over! A GIGANTIC THANK YOU to Marina, Tiffany and everybody that has given me the opportunity to participate in the OPW. I cannot start expressing how grateful I am for the chance... and for the confidence boost that comes with it!

But the time is not over yet, and I still have work to do.

I have to do: example of MenuButton (ok), of Scrollbar (ok, I guess), of StatusIcon (it has appeared there tonight: is it going to be a sisyphean work? - but ok, again!), of Tooltip (I plan to do something simple, so: ok)... and a "create your own" widget.

And that is not ok.

I am completely at loss for ideas! So, please, dear readers... if you have any suggestion, let me know in the comments! I cannot guarantee I will follow all of your suggestions, of course: but I would really love some input.

In the meanwhile, I am doing all over again my example for ButtonBox, since I was inspired by the "nifty calculator" by Daniel Sielgel. Mine should be a bit simpler, though...

(Also missing - alas, completely missing! - are the exercises for the tutorial. That will be a work to be done after the end of the internship - my goal now is to have all the examples and theory pages ready for the 20th. Yes, that includes the mysterious "custom widget"! As I told you in the title, a cliffhanger...)

Comments & suggestions, as usual - and more than usual! - are welcome in the comments.

1 August 2012

GUADEC + 1 (actually: + 2)

OK, I got it wrong.

GUADEC did not really end on Sunday.

On Monday, I went to my first hackfest - the PyGObject hackfest. It was fantastic. Thank you to Martin Pitt and Paolo Borelli and John Palmieri and everyone (sorry, I am terrible at remembering names!) that helped me to learn so many new things. Thank you, in particular, for your patience with this beginner.

On Tuesday, I finally sat down at a table with Tiffany and we redesigned what I am doing for this summer, given the many useful suggestions we had during GUADEC. The new idea: you should be able to consult the "example" pages (which are divided into: example, code for the example, useful methods, API references, exercises) both from a page that groups the widgets by "category" (windows, display widgets, buttons...) and from a page that gives you a series of "lessons" - a more "sequential" tutorial. The former is aimed at more expert hackers, whereas the latter is for almost absolute beginners. In the latter there are also the "theory" pages (properties, the MVC design...). For the order of the tutorial I owe a lot to Taryn Fox's page here (although I changed some things).

Any suggestion is, as always, very welcome!

29 July 2012

Last day of GUADEC ahead...

After three intense days, which feel as full as a week and quick as a minute; after beautiful talks (not as many as I had hoped to have time or strength for), addictive chats (I did not expect as many, I want more!), great parties (thank you, organizing committee), games to rival the Olympics (thank you, Game Master! Also: we won!), general hacking (thank you yet another time, Tiffany; and thank you to Ryan and Colin who helped us), and last but not least incredible people, GUADEC 2012 will end today. It will be missed...

And at 3:30pm and something I will present my lightning talk on The 0 Beginners Tutorial for using GTK+ in Python. Feel free to come and/or to ask me about the content of the talk when you see me around... I surely have a lot of question for you if you are interested in the subject, since the tutorial is a work in progress and I am always trying to improve it!

and I love every minute of it!

25 July 2012

Greetings from A Coruña.

I am getting used to eating dinner at 9:30pm (as opposed to 7:00pm, like we usually do in London).

Now I am waiting for the pre-registration event, for my mentor to arrive, for the conference to start!

And of course there are at least two talks I want to attend that are scheduled at the same time...

28 June 2012

Theory and practice are always the same thing. In theory, not in practice.

Ok, I said: "The main idea: one page, one widget; one widget, one page." in the last post about the 0 Beginners Tutorial, two weeks ago. (My, how time flies and all that sort of things!)

Of course, since things are never going to be as planned, this is not what will happen.

First thought, about ten days ago: "It would be nice to talk a bit about strings and Unicode, on the model of what Sebastian Pölsterl does here". Then it occurred to me that also this page of his tutorial is a great model too.

So: three pages (strings, signals and callback functions, properties) that are not attached to a widget - but linked from some widgets' pages.

Then I was about to rewrite the TreeView widget documentation page, and the ComboBox documentation page... and here comes the idea to write a page about the Model/View/Controller design, about TreeModel and its implementations ListStore and TreeStore, so that the similarities of TreeView and ComboBox are clearer (and therefore it is easier to learn both - my opinion is that ComboBox is slightly easier, but difficulty is always subjective!). Also: in the plan for the tutorial there are two ComboBox examples and four TreeView examples. To repeat a long explanation on the M/V/C design and the methods for TreeModel & friends would make things more confused.

So, now: off to write the M/V/C design page! And then hopefully I will be able to write some code samples again... I miss my Python! (Sorry Mallard, nothing against you...)

As usual: your thoughts? Ideas?

14 June 2012

What's in a page?

A page of the O Beginners Tutorial for Gtk+ in Python, I mean...

First of all, there is an image of a window with the widget "in action".

Then there is the code to get exactly that example. Heavily commented: each line is explained (ok, the "here we set the width and the length of the window" is left out after a couple of examples).

In some cases, here there is a note to comment the code even further.

Then (thanks Jewelfox for the idea!) a series of "useful methods for this widget". I am thinking of writing this part as a list (one method for each bulletpoint), but in a relatively conversational style because a "plain" list could bore you and make you miss some parts while you skim over it. A great help in this is the tutorial by Sebastian Pölsterl, from which I already took an example (and that has been my Rosetta Stone between the C of the Gtk+3 Reference Manual and Python).

Finally, all the links to the pages in the Gtk+3 Reference Manual that I used to write the example.

Is there anything else you would like? Is there anything else you would do differently? If so, leave a comment...

And the Bigger Picture? The Tutorial Itself?

The main idea: one page, one widget; one widget, one page.

Then: a map! A graph to describe "from here you can go here, there, or there", and "to get here you will need what you learn there". And how would you do that? Only via hyperlinks on the page? Wouldn't they get lost in the variety of links described above - and wouldn't the bigger picture of the tutorial get lost in it? On the other hand: a "real" graph for all the examples needed for the tutorial could be a little too tangled...

[And: how's the work progressing? After a first very rough draft of many (but not all) widgets, so far I have written better pages for the window widgets (Gtk.Window, Gtk.ApplicationWindow, Gtk.Dialog, Gtk.AboutDialog, Gtk.MessageDialog) and I am now dealing with version 0.2 of the display widgets' pages (Gtk.Image, Gtk.Label, Gtk.Spinner, Gtk.Statusbar, Gtk.Progressbar). To come: buttons and toggles, numeric and text data entry, Gtk.TextView and more, including list and tree widgets (and therefore Gtk.ListStore and Gtk.TreeStore).]

8 June 2012

Yet another OPW update!

What, more than ten days have already passed from my last post? What was I thinking? What was I doing?

Oh, yes: I was writing! Code and documentation pages!

First look at the "samples needed" section in the Documentation Project page, then I look at the Gtk+ 3 Reference Manual. When I find a sample that is needed that sounds doable given my current knowledge, I write an example. If an example is already there in another language (usually Vala, thanks Tiffany!) I "translate" it in Python; otherwise I improvise.

Then there is the documentation: if the example is a first, I take a screenshot (Taryn explained here the magic of alt-prt sc - and much more; for the combobox the setting "take screenshot with some delay" was needed to capture the menu that was dropped down, and some Gimp was needed to delete drop shadows). Then I write a .page in Mallard on the model of the ones already there (thanks all the documentation team that wrote that page). The page so far is only composed of:
  • screenshot
  • short explanation of what the screenshot is
  • code used to obtain that screenshot (in the best cases, very commented along the lines of "here we do this; here we do that")
  • links to the Gtk+ 3 reference manual pages I looked at when I wrote the code (this part is missing in some pages, I promise to do it as soon as possible). I know: those pages are written for C programmers. Some of the methods don't work in Python. If anyone has any idea of something more Python-friendly I can link, please tell me!
Is there something else you would like? Is there something you would like to be different?

Finally, I commit with git my work, as explained - again - here.

Repeat for each sample...

[Final note, the usual: "things I would have done differently with hindsight": the combobox after the treeview was much easier. But maybe it is because the model is the same, so the problem was getting in the mindset...]

[Another final note: yes, the list was also because I wanted to see the little feet on my post on the Planet too.]

[Really-final note: I ask a lot of questions, I would love to hear from you in the comments. But: due to having an annoying internet stalker - long story, it even involved London's Metropolitan Police at one time - I have to moderate all my comments in all my blogs. So: I'm sorry for the delay, please bear with me while I approve your comment...]

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?

...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


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...

23 April 2012

Why the title...?

Well, I got in. GNOME Outreach Program for Women, GOPW if you like acronyms.
So, now: a blog! A technichal blog!
But before getting to the technical stuff: why the title, you might ask? That is why I love to cook, and there is an old story about programming and women. I found it here.
So now you know: I am a feminist, I love to cook, and I would like to be a computer programmer. Quite a lot, I know.
(Oh, by the way: I have a lot less hair than the computer girl in the photos. One cannot have everything.)