missing documentation about how to draw a window

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

missing documentation about how to draw a window

Olaf Hering
I was browsing gtk.org in the hope to find a guide about how application developers are supposed to manage the contents of the windows they are about to draw in their applications. Unfortunately I found no guidance about that.

Lets take the window where I type this email right now for example. Most GUI have that "New Mail" window, with a menu bar at the top, followed by the list of author and recipients, followed by subject and finally the text area. At the end there is maybe a status row.

How is an application supposed to know what the maximum "height" and "width" of that window is? In my case the total screen height has to be subtracted by the application panel of the desktop, but maybe that panel is vertically aligned so more of the full height would be available. Then this window may have titlebar, and some border of varying width does exist as well.

If all of the above would be known by the application, it could start collecting the various items to be drawn inside that window, and make decisions about how the available space should be distributed. For example, an email with many recipients will result in a long list and therefore take too much space. As a result, the text area below it may be just one line or not be shown at all. So it has to decide if that list needs a scrollbar or not.

Similar with the width of that window. The app may decide that the width should be old-style fixed-width 80 chars. This would leave little room for the menubar and the recipients, which may have very long names.

Unfortunately, the app I decided to use goes the easy way: it asks for the size if the window and stores that size in its preferences in the hope the values will fit just fine for the next email. As you can guess, these values will not fit the next time. It also uses gtk_widget_set_size_request and similar with often hardcoded values, which means various buttons may overlap or whatever damage can be done with that approach.

I browsed the API documentation, and maybe one can find out by try-and-error. It also looks as if gtk3 has more knobs than gtk2 had, based on the available function names. It would be good if a document exists to obtain and use the information I have outlined above.

Thanks,

Olaf

_______________________________________________
gtk-app-devel-list mailing list
[hidden email]
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list