packed panedwindow doesn't fill as expected

Liste des GroupesRevenir à cl tcl 
Sujet : packed panedwindow doesn't fill as expected
De : luc (at) *nospam* sep.invalid (Luc)
Groupes : comp.lang.tcl
Date : 04. Oct 2024, 16:45:45
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20241004124545.18ce0e7f@lud1.home>
Of course, my expectations are often wrong.

This code works perfectly as expected:

-------------------------
package require Tk
package require tile
wm withdraw .
set ::w [toplevel .topw]
wm resizable .topw 1 1
wm attributes .topw -zoomed 1
wm geometry .topw 600x100+0+0
bind $::w <Escape> {exit 0}
wm protocol $::w WM_DELETE_WINDOW {exit 0}

set ::outerframe [frame $w.outerframe -background "red" ]
pack $::outerframe -fill both -expand 1
set ::tabframe [frame $::outerframe.tabframe -background "blue"]
pack $::tabframe -fill both -expand 0 -ipadx 100 -ipady 0
set tabbutton [button $tabframe.tabbutton -text "Tab" -font "Freesans 12"]
pack $tabbutton -fill x -expand 0 -side left

set ::pathlineframe [frame $::outerframe.pathlineframe -background "black" -cursor "arrow" -bd 6]
pack $::pathlineframe -fill x -expand 1 -side top -anchor n
set ::pathline [entry $::pathlineframe.pathline -background "yellow" -font "Freesans 14" -bd 2]
pack $::pathline -fill x -expand 1 -side left -ipadx 100
set menubutton [button $::pathlineframe.menubutton -text "Menu" -font "Freesans 12"]
pack $menubutton
-------------------------


Now I want to fill up the entire red area (which is the super big master
"outer" frame which contains everything) with a panedwindow.

The panedwindow has pink background. Let's try:


-------------------------
package require Tk
package require tile
wm withdraw .
set ::w [toplevel .topw]
wm resizable .topw 1 1
wm attributes .topw -zoomed 1
wm geometry .topw 600x100+0+0
bind $::w <Escape> {exit 0}
wm protocol $::w WM_DELETE_WINDOW {exit 0}

set ::outerframe [frame $w.outerframe -background "red" ]
pack $::outerframe -fill both -expand 1
set ::tabframe [frame $::outerframe.tabframe -background "blue"]
pack $::tabframe -fill both -expand 0 -ipadx 100 -ipady 0
set tabbutton [button $tabframe.tabbutton -text "Tab" -font "Freesans 12"]
pack $tabbutton -fill x -expand 0 -side left

set ::pathlineframe [frame $::outerframe.pathlineframe -background "black" -cursor "arrow" -bd 6]
pack $::pathlineframe -fill x -expand 1 -side top -anchor n
set ::pathline [entry $::pathlineframe.pathline -background "yellow" -font "Freesans 14" -bd 2]
pack $::pathline -fill x -expand 1 -side left -ipadx 100
set menubutton [button $::pathlineframe.menubutton -text "Menu" -font "Freesans 12"]
pack $menubutton

set unipane [panedwindow $::outerframe.unipane]
pack $unipane -fill both -expand 1
$unipane configure -background "pink"
-------------------------

So the panedwindow is in right place, but how come it is not filling up
the entire available space? Isn't that what -fill both is supposed to do?

Sometimes it's really hard to understand pack. Then again, I don't
think grid is that easy either.

--
Luc
>


Date Sujet#  Auteur
4 Oct 24 * packed panedwindow doesn't fill as expected2Luc
4 Oct 24 `- Re: packed panedwindow doesn't fill as expected1nemethi

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal