O5B-->

About GNOME · Download · Support · Community · Developers · Foundation · Contact




GNOME Support Forums
GNOME Desktop user support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[GTK+] How to achieve precise alignment & standard spaci

 
Post new topic   Reply to topic    GNOME Support Forums Forum Index -> Development
View previous topic :: View next topic  
Author Message
fidel
Newbie
Newbie


Joined: 06 Mar 2010
Posts: 2

PostPosted: Tue Mar 09, 2010 1:19 pm    Post subject: [GTK+] How to achieve precise alignment & standard spaci Reply with quote

If you put various widgets in a VBox, they don't line up. Some widgets seem to have internal spacing that prevents them from sitting flush on the borders of their containers. For example, buttons have 1 pixel of extra space around them, checkboxes have 2 pixels of extra space, etc.

If a person wanted to follow the GNOME Human Interface Guidelines, and use absolutely precise alignment and standard spacing in multiples of 6 pixels, what would be the cleanest way to do that? At the moment all I can think of is to calculate border widths and spacing using magic numbers that are based either on observed behavior or on reading source files like button.c, checkbutton.c, etc.

If you want to see a quick example of this issue, have a look at the Find dialog in gedit. Things don't line up on either the left or the right margin, the vertical spacing is inconsistent, and the observed space between buttons in the dialog's action area is 2 pixels larger than what the programmer specified.

Ordinarily I wouldn't be so picky, but I'm working on a layout tutorial which was supposed to make gtkmm programming look simple and hack-free. Is there a clean way to work around this?

Thanks.


Last edited by fidel on Thu Mar 11, 2010 1:44 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
fidel
Newbie
Newbie


Joined: 06 Mar 2010
Posts: 2

PostPosted: Thu Mar 11, 2010 1:43 pm    Post subject: Reply with quote

I've concluded that the extra spacing around checkbuttons and buttons is just part of the de facto GNOME style. It's obviously not the same as (cough) Qt or .NET widgets, which align flush by default. But since it traces back to a decision by the GTK+ designers then it's just "the way life should be" in GNOME, sweet GNOME.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    GNOME Support Forums Forum Index -> Development All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


FootNotes | Official GNOME Website | GnomeSupport.org

Add to Mozilla Sidebar

Powered by phpBB © 2001, 2005 phpBB Group