[Tutor] Using tkinter for cross platform application

Alan Gauld alan.gauld at btinternet.com
Tue Sep 3 11:30:25 CEST 2013


On 03/09/13 02:32, Max Bedacht wrote:
> Hello;
> I'm looking for a quick, if possible, solution to a problem I'm having.

:-)

Does anyone ever look for a slow solution?...

> The problem that I am now trying to resolve, which I hope is the last
> one, is the following:
>
> When running a packaged 'compiled' version on all windows platforms the
> screen, while complete, is reduced by about 20% from the Linux version,

You don't give us much detail here. What is the "screen"?
How is it compiled? Does a non compiled version work OK?

> where the development was mostly done. Images seem all to be the same
> size, as is the main window, but all of the text, labels and buttons are
> reduced in size, not by much, but enough to be annoying.

You tell us it is Tkinter based but don't describe what
the GUI looks like so we have no idea what bits of Tkinter
you are using. Some Tkinter widgets are designed to adopt
the host GUI look n' feel for example so we'd expect them
to look different on each platform.

> this size difference does not happen in my development environment
> (Eclipse/PyDev). There, if anything, the text in windows seems to be a
> bit larger than that in Linux).

This confuses me because Eclipse doesn't display the GUI so what text is 
it that is bigger in Eclipse? Are you talking about Eclipse itself?

> I seem to have 3 options at this point:
>
>      1. live with it;
>      2. adjust the image portion, which seems fixed in size, to be x%
>         smaller in the Windows environment, making the overall window
>         smaller but maintaining proportionality;

How are you displaying the image? Is it in a Canvas? Text widget, or 
part of a label?

Images are often specified with explicit sizes so I'd expect the image 
to be more likely to stay constant but text is often dependent on system 
settings.

>      3. see if there is a magic bullet to resolve this issue.
> (Ubuntu 13.04 (64bit), Lubuntu 13.04(32Bit), Windows 8(64Bit), Windows
> 7(64Bit), Windows XP
> Python 2.7 and 3.3 64Bit on the Ubuntu box.
> Python 2.7 and 3.3 32Bit on the Windows boxes

You might get a better response posting on the Tkinter mailing list, 
there are a lot of folks there using different OS versions etc.
It may be a well known problem there.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list