|
From: Jeff H. <je...@Ac...> - 2004-12-27 19:48:45
|
> > The -width option for tile labels is always in characters, even if the > > widget contains an image (in this case, the value of the > It should only be ignored if the text label is not displayed > at all, i.e., if '-compound image' or '-compound none -image > $someImage' is specified. The core actually interprets -width in pixels if any image is associated with the widget. I'm not sure this is the right thing to do for compound widgets, but that's what it does. > ... at least that's what's supposed to happen; looks like > it isn't implemented correctly. But the intended behavior > is that '-width' always specifies the width in characters > of the text part of the label, regardless of the value of > '-compound' and '-image'. That sounds more reasonable ... but isn't what Tk label does. Test: package require Tk image create photo logo -file $tk_library/images/logo64.gif pack [label .l -image logo -text "1234567" -font Courier -bg pink] .l configure -compound left .l configure -width 5 .l configure -width 50 Jeff |