For Programmers: Free Programming Magazines  


Home > Archive > Tcl > January 2008 > Re: Button doesn't have to resize when the screen resolution is









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Button doesn't have to resize when the screen resolution is
alexg

2008-01-25, 7:26 pm

On Jan 25, 12:34 pm, schlenk <schl...@uni-oldenburg.de> wrote:
> alexg wrote:
>
> Check if tk scaling changes or not. It might be that your X server
> isn't telling the truth about it and that breaks the scaling.
>
> Seehttp://wiki.tcl.tk/8484
>
> Michael


Michael,
Thank you for a so quick response.
Tk scaling is OK.
Again, the problem:
We made a GUI that has the same size on all resolutions (by specifying
the widgets' sizes in centimeters, not pixels).
So when we change resolution the GUI's frames and buttons remain the
same size on screen (size changes in pixels), but the pictures that we
made for the buttons don't scale to fit the button's size.
(instead of fonts - that don't work for what we need - we made a
picture for each button, but they don't scale according to button
size, we want the pictures to resize along with the buttons they are
attached to)
Bryan Oakley

2008-01-25, 7:26 pm

alexg wrote:

> Again, the problem:
> We made a GUI that has the same size on all resolutions (by specifying
> the widgets' sizes in centimeters, not pixels).
> So when we change resolution the GUI's frames and buttons remain the
> same size on screen (size changes in pixels), but the pictures that we
> made for the buttons don't scale to fit the button's size.
> (instead of fonts - that don't work for what we need - we made a
> picture for each button, but they don't scale according to button
> size, we want the pictures to resize along with the buttons they are
> attached to)


There is nothing in Tk that will cause the image to change dimensions.
If you have an image that is 16 pixels wide, it will remain 16 pixels
wide regardless of the resolution or size of the button.

What you need is support for scalable vector graphics, but Tk doesn't
support that.

With a fair amount of work you could determine the width of the button
in pixels then call a function to rescale the image yourself. Unless the
new size is an even multiple of the old size the image probably won't
look particularly good.

You might want to check out tkpath, which would let you draw SVG images.
http://tclbitprint.sourceforge.net/


--
Bryan Oakley
http://www.tclscripting.com
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com