Re: Packing problems
- From: Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 08 Jan 2007 17:33:04 GMT
Dave (from the UK) wrote:
It is that window (Tools -> Download from TWIC) I am writing at this point. It is only part of a much larger program and the help for the program is on the main Help menu. This is very specific to this page.
I made it a complete script which would run without the rest of the code simply so I could post it and someone run it quickly without downloading lots of code. But the main help menu is not here.
Ah, ok. You're creating a dialog rather than a program. In that case you should probably have a standard "OK" button, and there's a platform-specific pattern of where to put OK relative to Help and to the rest of the dialog.
It now has a box under help - do you think this is OK? It still seems a bit odd, needing an extra mouse click, but perhaps its more conventional.
Well, without trying to confuse things too much... menubars are typically for the primary window in an application. If you are creating secondary windows, those follow slightly different rules.
I'm still stuck on how to move the frames around as I want. The check boxes are right justified, but the frame there are in is centered horizontally. I want to move it to the left, whilst keeping it below the text box. (i.e. I want the check boxes on the far left). I can seem to leave them where they are, or put them to the left of the text box (which looks much worst), but I can't seem to achieve what I want.
pack $cbf .downloadstatus $bf -anchor w
Note the addition of the -anchor option
...
The colours on the backgrounds are there simply so I can see problems. I don't really want such colours around.
That is excellent technique. I use it sometimes myself.
BTW: pack your text widget absolutely last and you'll get better resize behavior. More about that can be read here: http://www.tclscripting.com/articles/feb06/article3.html
Finally, a comment on this block of code:
# Frame 4 (Only one widget so I won't really use a frame)
text .downloadstatus -height 1 -fg red -bg blue
Many windows applications put both the scrollbar and text widget inside a common frame that is sunken. Take a look at notepad.exe for example. This (arguably) gives a slightly better appearance. Not only that, it makes it possible to manage the text and scrollbar widgets as a single unit.
Compare how the two text widget / scrollbar combos look in the following example:
# text widget & scrollbar inside a sunken frame
frame .container1 -borderwidth 1 -relief sunken
text .text1 -borderwidth 0
scrollbar .vsb1
pack .vsb1 -in .container1 -side right -fill y
pack .text1 -in .container1 -side left -fill both -expand 1
# text and widget outside a sunken frame
frame .container2 -borderwidth 0
text .text2 -borderwidth 1
scrollbar .vsb2
pack .vsb2 -in .container2 -side right -fill y
pack .text2 -in .container2 -side left -fill both -expand 1
pack .container1 .container2 -fill both -expand 1 -padx 4 -pady 4
BTW: if you change the ordering of the "pack .vsb1" and "pack .text1" commands (doing text first, then scrollbar) and then resize the window to be smaller, you'll see the effect I describe in the tclscripting.com article where the scrollbars disappear before the text widget shrinks.
.
- Follow-Ups:
- Re: Packing problems
- From: Dave (from the UK)
- Re: Packing problems
- References:
- Packing problems
- From: Dave (from the UK)
- Re: Packing problems
- From: ¤WildCard¤
- Re: Packing problems
- From: Dave (from the UK)
- Re: Packing problems
- From: Bryan Oakley
- Re: Packing problems
- From: Dave (from the UK)
- Re: Packing problems
- From: Darren New
- Re: Packing problems
- From: Dave (from the UK)
- Re: Packing problems
- From: Darren New
- Re: Packing problems
- From: Dave (from the UK)
- Packing problems
- Prev by Date: Re: Packing problems
- Next by Date: Internet access from tcl program does not cause auto dial in windows
- Previous by thread: Re: Packing problems
- Next by thread: Re: Packing problems
- Index(es):
Relevant Pages
|