From: Erik Leunissen on
Robert Heller wrote:
>
> -borderwidth, -relief
>

Please note the "-bd 0" in my original post.

Erik.
--
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
tom.rmadilo wrote:
>
> 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.

That might be the case, and actually, this had crossed my mind too for a
moment.

But then, why is it different on Windows (where buttons have the same
image action)?

Erik.
--
leunissen@ nl | Merge the left part of these two lines into one,
e. hccnet. | respecting a character's position in a line.
From: Jonathan Bromley on
On Mon, 08 Feb 2010 23:10:08 +0100, Erik Leunissen wrote:

>> -borderwidth, -relief
>
>Please note the "-bd 0" in my original post.

did you also set "-highlightthickness 0" ?
I think it's set to 2 by default on a canvas;
don't know about anything else. Its existence
can do unexpected things to a canvas coordinate
system.
--
Jonathan Bromley
From: Robert Heller on
At Mon, 08 Feb 2010 23:17:25 +0100 Erik Leunissen <look(a)the.footer.invalid> wrote:

>
> tom.rmadilo wrote:
> >
> > 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.
>
> That might be the case, and actually, this had crossed my mind too for a
> moment.
>
> But then, why is it different on Windows (where buttons have the same
> image action)?

Buttons under MS-Windows (and MacOSX) use 'native' widgets. Under
Linux/UNIX they use Tk's widget code.

>
> 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: tom.rmadilo on
On Feb 8, 2:17 pm, Erik Leunissen <l...(a)the.footer.invalid> wrote:
> tom.rmadilo wrote:
>
> > 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.
>
> That might be the case, and actually, this had crossed my mind too for a
> moment.
>
> But then, why is it different on Windows (where buttons have the same
> image action)?

My guess...I've been struggling with the same issue, so I would really
like to know...is that the [winfo height/width] thing isn't
necessarily a good way to measure the result of the widget creation.

For instance, if I enlarge or shrink the window, the [winfo height/
width] changes, although the button remains the same size.

I did the same test using ttk widgets and I get the same problem: one
or two extra pixels in space all the way around. On linux, the default
ttk button doesn't move:

package require Tcl 8.5
package require Tk 8.5

ttk::style theme use default

image create photo img -file ./favicon.gif -height 16 -width 16

ttk::button .b -image img -style B.TButton
..b configure -padding {0 0 0 0}

ttk::style configure B.TButton -relief flat -padding {0 0 0 0} -width
-1 -shiftrelief -1
pack .b

update idletasks

winfo width .b
winfo height .b

I get 19 (16+3) for winfo width/height.