Re: [TCLCORE] Crossplatform Tk differences
by Michael Schlenker other posts by this author
Apr 28 2008 2:27PM messages near this date
[TCLCORE] Crossplatform Tk differences
|
Re: [TCLCORE] Crossplatform Tk differences
Am 28.04.2008 um 17:59 schrieb Carlos Tasada:
> Hi guys,
In general this is the wrong mailing list for such questions. Better
direct your general Tcl/Tk related questions to the comp.lang.tcl
newsgroup.
This mailing list is for the development of the core Tcl language
(including Tk).
>
> I've just found an annoying problem when executing the same code in
> Windows and Linux. I'm using ActiveTcl 8.5.1 and I detected some
> different look between the Windows and Linux windows, when checking
> the code I found that the Tk objects (i.e a button) have different
> sizes in both platforms
>
> % button .b1 -text "OK" -font {arial 8} -width 10
> % pack .b1
>
> In Linux
> % winfo geometry .b1
> 86x25+0+0
> % winfo pixels . 1i
> 87
>
> In Windows
> % winfo geometry .b1
> 70x25+22+0
> % winfo pixels . 1i
> 96
>
Building apps that depend on the absolute pixel sizes is bad style,
especially if you later need to add on i18n stuff. And Tk's grid
manager makes it easy enough to get a decent resize behaviour.
First hint is: You specify Arial 8 as a font and button will adapt its
size to it, but your totally in the hand of the font server/font
subsystem how large arial 8 is in pixels. And as button specifies its
width in characters if it contains text you could only fix the font
issues. And getting Linux and Windows machine to use the same font
metrics is probably even harder than fixing your app to use a dynamic
layout.
Michael
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Carlos Tasada
Michael Schlenker
Donal K. Fellows
|