Home > Archive > Tcl > August 2004 > tixPanedWindow problem: Natural size of subwidgets is incorrect
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 |
tixPanedWindow problem: Natural size of subwidgets is incorrect
|
|
| Dirk Thierbach 2004-08-30, 3:59 pm |
| I am having the following problem with tixPanedWindow: For some reason,
I am not able to use multiple frames inside a pane, and have the pane
work with the "correct" natural geometry. I can use one frame with
non-container widgets on it, and that works fine. When I try to add
a second frame, both are displayed, but the natural size is the one
of the first frame. When I put the two frames into one bigger frame,
the natural size seems to become zero. I can use the -size option
to get the correct behaviour, but that doesn't work if I don't
know the correct size of both frames in advance, for example if the
user can change the fonts used in them.
What's the correct way to do this? Or is it a bug in tixPanedWindow?
Below is a stupid example program that demonstrates the problem.
When you run it, the buttons are not visible by default; you
have to enlarge the pane to be able to seem them.
Thanks for any help. If it matters, I am using the Debian itesting packages
tix8.1 (version 8.1.4-6), which in turn uses tcl8.4 (version 8.4.6-1).
- Dirk
------------------------------ snip ------------------------------
set m [frame .main]
set pp [tixPanedWindow $m.p -orientation vertical -dynamicgeometry true]
set p [$pp add top -expand 0]
set f [frame $p.f]
label $f.l -text "Hallo"
grid $f.l
pack $f
set p [$pp add bot -expand 0]
# Uncomment this to put both frames into one big frame
# set p [frame $p.p]
# pack $p -fill both -expand yes
set f [frame $p.f]
label $f.l -text "Links"
label $f.r -text "Rechts"
text $f.t -height 4 -width 20
grid $f.l $f.r -sticky w
grid $f.r -sticky e
grid $f.t - -sticky nswe
grid columnconfigure $f 1 -weight 1
grid rowconfigure $f 1 -weight 1
grid $f -sticky nswe
set f [frame $p.b]
button $f.1 -text "Knopf 1"
button $f.2 -text "Knopf 2"
grid $f.1 $f.2 -sticky we
grid $f -sticky we
$pp add filler -expand 1
pack $pp -fill both -expand yes
pack $m -fill both -expand yes
| |
| Jeff Hobbs 2004-08-30, 8:58 pm |
| Dirk Thierbach wrote:
> I am having the following problem with tixPanedWindow: For some reason,
...
> Thanks for any help. If it matters, I am using the Debian itesting packages
> tix8.1 (version 8.1.4-6), which in turn uses tcl8.4 (version 8.4.6-1).
If you are using Tcl/Tk 8.4, why don't you use the new core
panedwindow widget in 8.4 instead of the Tix one?
--
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
| |
| Dirk Thierbach 2004-08-31, 3:58 am |
| Jeff Hobbs <jeffh@removethis.activestate.com> wrote:
> If you are using Tcl/Tk 8.4, why don't you use the new core
> panedwindow widget in 8.4 instead of the Tix one?
Because I didn't know it was there -- it's been some time since I used
Tcl/Tk last, and Debian just installed the newest package for me.
Thanks, with panedwindow it works. So I guess it's a bug in
tixPanedWindow.
- Dirk
|
|
|
|
|