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

2 comments :

  1. I was thinking of providing more than just a bare-bones description for each sample ... like, a summary of how you can modify it by using different methods and properties. That's partly because, like with Python, JavaScript's very clumsily documented right now, and I don't feel comfortable just linking people to roojs.org and letting them drink from the firehose.

    I'm sorry about your stalker. ._.

    ReplyDelete
  2. Good idea - I should use it!

    (Thank you for the sympathy for the stalker business. :-))

    ReplyDelete