For Programmers: Free Programming Magazines  


Home > Archive > Tcl > July 2005 > Re: Panedwindow problems !!!









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: Panedwindow problems !!!
chengye.geo@yahoo.com

2005-07-24, 10:09 pm

The packing algorithm works like this, a widget of a higher packing
order gets the available space first. Followng this rule, you may
choose a packing order for a list of widgets such that some are always
visible.

Try

# packing main window
pack .status -side bottom
pack .menuber .fl .pnd -side top

# packing pane window
pack .pnd.check -expand 1 -fill x -side bottom
pack .pnd.text -expand 1 -fill y -side right
pack .pnd.canv -expand 1 -fill both -side right

Now you should have an expansible pane with a status bar at bottom and
a menubar at top. In side the pane window, the canvas is expansible in
both xy and text in y.

If you are using a Tk PANE widget, .pnd.text and .pnd.canv will be
packed in left and right pane respectively, and theie sizes will be
managered by the PANE widget. You only need to pack the pane and
checktext which should be packed first at the bottom of the pane frame.

For the second question, you may choose to use global variables, which
always work fine. You may also choose to use upvar or namespace that
will work too. My choice is to use global variables because of the
simplicity.

Chengye Mao
http://www.geocities.com/~chengye

Cassy wrote:
> Hi,
>
> I didn't get you on your first solution, because then the menubar and
> the frame with my shortcut buttons will come down as I have changed my
> packing order.
>
> Also I tried the same and resizing problem remains.
>
> Maybe I forgot to tell you that, the architecture of my program is like
> this:
>
> 1. .menubar (on the top)
> 2. .f1 - Shortcut bar with some buttons below the menubar
> 3. Panedwindow .pnd that contains an internal paned window and a text
> window (I call it the checktext window).
> 4. The internal panedwindow contains a canvas on the left and text on
> the right.
> 5. The checktext window is the other part of the main panedwindow, its
> placed bottom to the internal panedwindow as can be seen.
> 6. And then the status bar comes at the end.
>
> I tried the hierarchial packing but no change, please check , my
> request to you.
>
> About the second questionn I want to make somthing like this, add some
> widgets, change them when clicked on them, like a collapse/expand
> (+/-) in some GUI's ...
> To do that I have to use bindings, so when I have a proc that accepts
> the tag for the canvas and I want to insert something using tht
> index/tag its fine, like <tag> <create text> ... etc.
>
> But when I want to bind on these created widgets inside the same proc
> it seems to forget these passed arguments, should i make them global,
> but I don't want to. Frankly, I don't know what to do ...


Sponsored Links







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

Copyright 2008 codecomments.com