Re: GtkLabel inside an eventbox



Bohdan Vlasyuk <bohdan kivc vstu vinnica ua> writes:

I've decided to try to write some silly programs with Gtk+, and I want
to make `xclock -d' clone. I'm putting GtkLabel inside an eventbox to
catch moushe clicks so that window will be closed after clicks [at
first, it was button not label-in-the-box :-) ]. This works fine,
however, I can't understand why Window is bigger than actual text is,
or, rather, taller [width are same, and button seen to behave
similarly]. What can be done with it ??


The label should be widget->style->font->ascent +
widget->style->font->descent in height, basically. This is the size of
the font, not the particular characters you're using. The reason for
that is so the size doesn't change as you set the label to different
text, which would cause weird bouncing effects.

If it isn't that size for you, send along a small test case showing
the problem.

Havoc





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