Re: Large GTK Application design tips


I am writtin an embedded application (GUI) in GTK. It is my first contact with GTK, and so far I learnt:
1. using glade and libglade is briliant idea.
2. access to widgets from different threads may be problematic. It is better to avoid it and access only from the main if possible (in my case it was not).
3. If you are using a touch-panel remember that the mouse pointer is a window property, so If you want to make it invisible, you will have to do it for each window separately (or have a base class for each window).
4. touch-panel - the problem I have at the moment is that sometimes "pressed" event is being received for the widget where the mouse pointer was at the moment of clicking, not for the widget I have clicked on.

Best regards,

2008/9/12 Vallone, Anthony <anthony vallone lmco com>
I haven't tried it on an embedded app, but it should only affect application startup time.  Once libglade has parsed the XML, and created the widgets, it "should" be as fast as any non-libglade GTK+ app.

From: Paul Stuart [mailto:Paul_Stuart seektech com]
Sent: Thursday, September 11, 2008 6:28 PM
To: Vallone, Anthony; gtk-list gnome org

Subject: RE: Large GTK Application design tips


 Thanks, great advice! Using glade is an interesting idea I hadn't considered since this is for an embedded product. Anyone have experience using it on an embedded platform (TI dm355 in my case)? Will the overhead eat me alive?



From: Vallone, Anthony [mailto:anthony vallone lmco com]
Sent: Thursday, September 11, 2008 2:05 PM
To: Paul Stuart; gtk-list gnome org
Subject: RE: Large GTK Application design tips


Hi Paul,


I led a very large government project using GTK+ and C++ with great success.  I don't know of any docs on the subject, but here are the top three tips that I had to learn the hard way:

  1. GTK+ is not thread safe, and the gdk_threads_enter/gdk_threads_leave calls don't always work.  When worker threads need to do something to the GUI, just use g_idle_add().
  2. Glade together with libglade is a must.  With your GUI layout defined in XML, its easy to make mass GUI changes via a script.  It also simplifies testing, since you don't need to re-compile when trying out different layouts.
  3. We created a C++ wrapper class hierarchy for each significant widget we use.  The wrappers allow us to easily change the look and/or behavior of all of those widgets in our system (ex: all non-editable GtkEntries have a grey background, or custom search box below all GtkTreeViews). The wrappers are also useful when you discover GTK+ quirks that you need to work around (All GUI toolkits have them). 

-Anthony Vallone


From: gtk-list-bounces gnome org [mailto:gtk-list-bounces gnome org] On Behalf Of Paul Stuart
Sent: Thursday, September 11, 2008 3:59 PM
To: gtk-list gnome org
Subject: Large GTK Application design tips


 I'm about to embark on designing a large application that will use GTK+. I was wondering if there are any resources out there that might have tips on architecture practices specific to GTk+, style guides, etc. I've written small apps, but I'm curious about how things scale up.


Any pointers would be appreciated!




gtk-list mailing list
gtk-list gnome org

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