From: Erik Leunissen on 7 Feb 2010 15:51 George Petasis wrote: > > Can you try with -width 20p -height 20p ? > Yes, I did. The result is incomprehensible as well: % winfo width .b 26 % winfo height .b 26 ??? Erik. > George -- leunissen@ nl | Merge the left part of these two lines into one, e. hccnet. | respecting a character's position in a line.
From: Erik Leunissen on 7 Feb 2010 15:57 Erik Leunissen wrote: > > Yes, I did. The result is incomprehensible as well: > > % winfo width .b > 26 > % winfo height .b > 26 > and on windows (where the script using "-width 20 -height 20" generates a button of exactly that size), I now get, using "-width 20p -height 20p": % winfo width .b 27 % winfo height .b 27 So there is a difference in using "20" or "20p" as the size. But it doesn't make me understand more of it ... Erik. -- leunissen@ nl | Merge the left part of these two lines into one, e. hccnet. | respecting a character's position in a line.
From: Robert Heller on 7 Feb 2010 18:30 At Sun, 07 Feb 2010 21:51:12 +0100 Erik Leunissen <look(a)the.footer.invalid> wrote: > > Roy Terry wrote: > > > > This area has gotten some changes from time to time. My recollection > > from several years ago is that buttons displaying images will > > completely ignore the -height and -width settings. My current Tk help > > file does not confirm this, but is that not the behavior you are > > seeing on Linux? > > Experimentation shows that the widget options are not being ignored: the > actual button sizes obtained with my sample script are always exactly 2 > pixels larger than I indicate through the widget options. > > Thanks anyway for your attention, -borderwidth, -relief > > Erik. -- Robert Heller -- 978-544-6933 Deepwoods Software -- Download the Model Railroad System http://www.deepsoft.com/ -- Binaries for Linux and MS-Windows heller(a)deepsoft.com -- http://www.deepsoft.com/ModelRailroadSystem/
From: George Petasis on 8 Feb 2010 12:20 στις 7/2/2010 22:57, O/H Erik Leunissen έγραψε: > Erik Leunissen wrote: >> >> Yes, I did. The result is incomprehensible as well: >> >> % winfo width .b >> 26 >> % winfo height .b >> 26 >> > > and on windows (where the script using "-width 20 -height 20" generates > a button of exactly that size), I now get, using "-width 20p -height 20p": > > % winfo width .b > 27 > % winfo height .b > 27 > > > So there is a difference in using "20" or "20p" as the size. But it > doesn't make me understand more of it ... > > Erik. For me, everything that deviates from the manual page is a bug: "Specifies a desired width for the button. If an image or bitmap is being displayed in the button then the value is in screen units (i.e. any of the forms acceptable to Tk_GetPixels). For a text button (no image or with -compound none) then the width specifies how much space in characters to allocate for the text label. If the width is negative then this specifies a minimum width. If this option is not specified, the button's desired width is computed from the size of the image or bitmap or text being displayed in it." I would suggest to file a bug for this in sourceforge. George
From: tom.rmadilo on 8 Feb 2010 16:22
On Feb 8, 9:20 am, George Petasis <peta...(a)iit.demokritos.gr> wrote: > ÏÏÎ¹Ï 7/2/2010 22:57, O/H Erik Leunissen ÎγÏαÏε: > > > > > > > Erik Leunissen wrote: > > >> Yes, I did. The result is incomprehensible as well: > > >> % winfo width .b > >> 26 > >> % winfo height .b > >> 26 > > > and on windows (where the script using "-width 20 -height 20" generates > > a button of exactly that size), I now get, using "-width 20p -height 20p": > > > % winfo width .b > > 27 > > % winfo height .b > > 27 > > > So there is a difference in using "20" or "20p" as the size. But it > > doesn't make me understand more of it ... > > > Erik. > > For me, everything that deviates from the manual page is a bug: > > "Specifies a desired width for the button. If an image or bitmap is > being displayed in the button then the value is in screen units (i.e. > any of the forms acceptable to Tk_GetPixels). For a text button (no > image or with -compound none) then the width specifies how much space in > characters to allocate for the text label. If the width is negative then > this specifies a minimum width. If this option is not specified, the > button's desired width is computed from the size of the image or bitmap > or text being displayed in it." Actually I think the extra two pixels comes from the room needed for the pressed button motion, which moves the image down and to the right. |