[bug, v0.99.3] frame->label_width (fwd)




(apologies if this message was re-sent, just subscribed to the list and
wasn't sure if it went through...)

Playing with changing the font size in (gimp's) gtkrc, I noticed frame
labels no longer fit in the space provided for them...  The blank space
in the frame was always that of the default font size
("-adobe-helvetica-medium-r-normal--*-120-*-*-*-*-*-*").  The full text
would still display, but it would run over on top of the frame line...
Smaller fonts simply don't take up the whole space.
http://www.aracnet.com/~kevint/gimp/gtkbug.png illustrates.  I checked
gtkframe.c and found

frame->label_width = gdk_string_measure (GTK_WIDGET (frame)->style->font, 
                                         frame->label) + 7;

To see what was up, I added this line to my program after it created
the frame:

  g_print("label_width: %d, %d\n",
          GTK_FRAME(msg_frame)->label_width,
          gdk_string_measure (GTK_WIDGET(msg_frame)->style->font,
                              GTK_FRAME(msg_frame)->label) + 7);

When the font size in gtkrc was default, it gave: 
label_width: 66, 66

But changing gtkrc and restarting with point size of 100 instead of 120: 
label_width: 66, 55

Point size 180: label_width: 66, 93

Unaware of gtk internals, I became rather mystified at this point and
decided to turn it over to you.

Have fun,
 - Kevin Turner




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