home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl
- Path: sparky!uunet!mcsun!dxcern!dxcern.cern.ch!trones
- From: trones@dxcern.cern.ch (Jostein Lodve Trones)
- Subject: Button-size in pix's or frame-size in char's?
- Message-ID: <1992Nov16.102838.17193@dxcern.cern.ch>
- Sender: news@dxcern.cern.ch (USENET News System)
- Reply-To: trones@dxcern.cern.ch (Jostein Lodve Trones)
- Organization: CERN, European Laboratory for Particle Physics, Geneva
- Date: Mon, 16 Nov 1992 10:28:38 GMT
- Lines: 36
-
-
- I hope somebody out there can help me with the following problem...
-
- I am going to open a frame containing some buttons in columns and rows.
- Since I will do this quite often, and with a different number of buttons,
- I am writing a procedure to do this.
-
- I use place instead of pack, because I want a somewhat speciall lay-out,
- with space around the buttons.
-
- The problem is that I need to know the size of the frame before I open it.
- But to calculate the size of the frame, I need to know the size of a button.
- The button's size is known in characters, but not in pixels.
-
- I thought of using the winfo command to return the button-size in pixels,
- but this do not work, unless the button is already placed or packed in
- the frame, and the frame already packed/placed on the root-window, or
- another packed/placed window.
-
- So I have the famous "chicken-and-the-egg" problem: I can not calculate
- the size of the button, unless the frame is opened, and I can not open
- the frame unless I know the size of the button...
- (With "open" I mean place/pack the window so that it is visible on the screen)
-
- I could of course first place the frame, then place a button on it, find
- the size and regeometrize(?) the frame, but is there a better way?
-
- What I actually need, is a way to get the button's size in pixels when
- I know the size in characters, or a way to specify the frame-size in
- characters.
-
-
- Thank you for any help!
-
- Cheers,
- Jostein
-