Re: keyboard events - for documentation



On Fri, Oct 14, 2011 at 12:49 PM, Kjell Ahlstedt
<kjell ahlstedt bredband net> wrote:
> tor 2011-10-13 klockan 19:50 +0100 skrev lecas malecas:
>> Hey,
>>
>> Events propagate to its parents, until you stop it or it reaches the top.
>> I don't remember where this is said in the documentation, but I've
>> seen this behaviour in other places (for example with html/javascript
>> in the web)...
>>
>> Yes I know that it needs more work, but I'm not used to writing this
>> kind of stuff..
>> Where are the formatting rules explained?
>
> I don't know. I also wonder. Does anyone know?
>

Searching a bit, I found these:

	http://faq.pygtk.org/index.py?file=faq03.011.htp&req=show
	http://www.gtk.org/tutorial1.2/gtk_tut-18.html

The python one says that the keyboard events work differently than
what I've thought...

> There is a GNU coding standard at http://www.gnu.org/prep/standards/,
> but gtkmm code is not formatted as described there. I think gtk+ and the
> other C modules use that standard.
> Look at some of the other example programs in the gtkmm tutorial. Not
> all of them are perfect, but most of them are very good.
>
> A few rules:
>
>  if (a < b)
>    a++;  // Indented two spaces
>  else
>  { // Brace not indented
>    b++;
>    func1(a, b);
>  }
>

I find it a bit weird for the {} to not have indentation too, also I
looked into the rest of the examples and the comments don't have
indentation as-well.. but I can change it, just don't think its as
readable.


> Don't insert tab characters in the source code. (I don't think you have,
> so just keep not doing it.)
>
> This is my personal opinion, rather than a rule:
>  return !isOk();
> is much better than
>  if (isOK() == true)
>    return false;
>  else
>    return true;
>
> I know that you're not the only one that disagrees with me.
>

Yes, I've thought about simplifying it a bit, but the thing is I don't
know who's going to be reading the code, and I've seen people having
difficulty with stuff like that, so I normally write the more explicit
way, this way no one gets hurt :)

> gtkmm-tutorial-in.xml is a DocBook file. You can find everything about
> DocBook at http://www.docbook.org/, but I don't think you'll have to
> read it. Just copy and paste in the gtkmm-tutorial-in.xml file. I've
> used a simple text editor (gedit) when I've modified that file. There
> are probably better tools for that task, but gedit is good enough for
> me.

That sure is a big file :)
Ok, I'll look into it later.

>>
>> Ohh, didn't know HBox was deprecated... I'll use Grid then.
>>
>>
>> Yes, I can try to do some of that, but there's some stuff (like the
>> rules, etc..) that I'm not familiar with.
>
> I can help you, when it's getting too difficult, or too time-consuming.

If you could help with improving the description, I have some
difficulty in writing proper english :)

>>
>> Well, I think it would have to be a new chapter, since its a new topic.
>>
>> Ok, I'll add to bugzilla when I update it.
>
> When you have filed your bug in Bugzilla, please post a short message to
> gtkmm-list.
>

https://bugzilla.gnome.org/show_bug.cgi?id=661857

> Kjell
>
>
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]