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
schlenk

2008-01-25, 7:26 pm

Alexg wrote:
[snip]
> But, if I add buttons in frames, problems start to appear. As I
> understood from manual, the width and height of buttons express the
> size of the text. But I want to set the size of these buttons in cm.
> So I created images for each button, because I saw that when a button
> holds an image, the width and height may receive input which are
> accepted by Tk_GetPixels. So I set the width and height of buttons
> like this:
> -width 0.47c -height 0.30c


That is the desired width, its not guaranteed that it matches the
actual width, if the geometry manager is done with it. Depends on your
pack/grid settings (eg. -expand or columnconfigure/rowconfigure). You
can check whats really requested and what was granted with the winfo
subcommands...

If you can use fonts you might be able to use this code as a starter,
probably needs some changes to calculate size in cm instead of pixels
(via tk scaling). You would then calculate the desired font sizes on
creation and configure your fonts to fit.

http://wiki.tcl.tk/14492

Michael
Sponsored Links







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

Copyright 2008 codecomments.com