Prev: Scrollable widget help
Next: A little list/dict bug?
From: Gerhard Reithofer on 19 May 2010 04:00 Hi TCLers, why {-width != -width}? pack [button .b -text Butn -width 10 -relief raised -bg red ] pack [menubutton .m -text Menu -width 10 -relief raised -bg green] These 2 commands create clearly differently sized "buttons". Any idea how to make them look equal/similar? % info patchlevel 8.5.8 TIA -- Gerhard Reithofer Tech-EDV Support Forum - http://support.tech-edv.co.at
From: Ralf Fassel on 19 May 2010 06:29 * Gerhard Reithofer <gerhard.reithofer(a)tech-edv.co.at> | pack [button .b -text Butn -width 10 -relief raised -bg red ] | pack [menubutton .m -text Menu -width 10 -relief raised -bg green] | | These 2 commands create clearly differently sized "buttons". | Any idea how to make them look equal/similar? Specify -padx for both (the defaults seem to be different for buttons and menubuttons as shown bu invokinmg 'configure' on both widgets). With -padx 0 on both I get quite similar widths (probably have to tweak -highlightthickness). R'
From: MSEdit on 19 May 2010 06:30 On May 19, 10:00 am, Gerhard Reithofer <gerhard.reitho...(a)tech- edv.co.at> wrote: > Hi TCLers, > why {-width != -width}? > > pack [button .b -text Butn -width 10 -relief raised -bg red ] > pack [menubutton .m -text Menu -width 10 -relief raised -bg green] > > These 2 commands create clearly differently sized "buttons". > Any idea how to make them look equal/similar? > > % info patchlevel > 8.5.8 > > TIA > -- > Gerhard Reithofer > Tech-EDV Support Forum -http://support.tech-edv.co.at Could this be something to do with borderwidths not padding i think that is only for tile. The menubutton is a system thing I believe try doing a [widget configure] and lookin at the attributes for xxxwidth. Martyn
From: Arndt Roger Schneider on 19 May 2010 09:13 Gerhard Reithofer schrieb: >Hi TCLers, > why {-width != -width}? > >pack [button .b -text Butn -width 10 -relief raised -bg red ] >pack [menubutton .m -text Menu -width 10 -relief raised -bg green] > >These 2 commands create clearly differently sized "buttons". > Any idea how to make them look equal/similar? > >% info patchlevel >8.5.8 > >TIA > > menubutton and button are different things. The menubutton features an additional indicator signifying the popup menu it may display, lex the menubutton must be larger than a button. Width is the amount of characters allotted to the caption of those controls. When using a proportional font, then the size of the caption may even differ depending on the text: button .b text Butn button .m -text Menu .... may have a different size. Use the geometry manager to control the size of a control! Never use "ipadx", "ipady", "padx" or "pady" --except of course you really know what you're doing. Use the *grid* manager to make the /geometry/ of controls identical -- pack, table(blt) and place work just as-well. --Btw. also avoid "width". -roger
From: Gerhard Reithofer on 19 May 2010 15:58 Hi all, On Wed, 19 May 2010, Arndt Roger Schneider wrote: > Gerhard Reithofer schrieb: > > > Hi TCLers, > > why {-width != -width}? > > > > pack [button .b -text Butn -width 10 -relief raised -bg red ] > > pack [menubutton .m -text Menu -width 10 -relief raised -bg green] .... > menubutton and button are different things. > The menubutton features an additional indicator signifying the > popup menu it may display, lex the menubutton must be larger > than a button. But without indicator it "could" be made identical. > Width is the amount of characters allotted to the caption > of those controls. > > When using a proportional font, then the size of the > caption may even differ depending on the text: That shouldn't happen. AFAIK a specific char (was it "W"?) is taken for calculation a defined width. At least with the same font the result should be identical (in same widget). > button .b text Butn > button .m -text Menu > > ... may have a different size. Thats true, therefore I specified the "-width". > Use the geometry manager to control the > size of a control! Never use "ipadx", "ipady", "padx" or "pady" > --except of course you really know what you're doing. > > Use the *grid* manager to make the /geometry/ of controls identical > -- pack, table(blt) and place work just as-well. > > --Btw. also avoid "width". Yes, that's easy ... if you know what todo ;-) But also -padx 0 brings great results, so both work for me and both solutions are not pixel-exact - which is no problem in my case. THX * -- Gerhard Reithofer Tech-EDV Support Forum - http://support.tech-edv.co.at
|
Pages: 1 Prev: Scrollable widget help Next: A little list/dict bug? |