gr8oblivion
Programmer
Hey,
I'm new to tcl/tk, and am trying to something relatively simple (I would assume)
essentially i have "nested" frames and I want the inner frame be centered inside the bigger outer/master frame... here's my code fragment:
frame .main.inner -borderwidth 2 -relief raised
set entryone ""
set entrytwo ""
label .main.inner.alabel -text "label"
pack .main.inner.alabel -in .main.inner
update
pack .main.inner -in .main -padx [expr ([expr [.main cget -width] - [winfo width .main.inner]] / 2)] -padx [expr ([expr [.main cget -height] - [winfo height .main.inner]] / 2)]
BUT, the winfo procedures both return "1" as the width/height of the .main.inner frame, even after i explicitly call "update" -- also, when i tried to use reqwidth/reqheight instead of height/width i still got "1" as the value...
What am i doing wrong?
Thanks in advance
I'm new to tcl/tk, and am trying to something relatively simple (I would assume)
essentially i have "nested" frames and I want the inner frame be centered inside the bigger outer/master frame... here's my code fragment:
frame .main.inner -borderwidth 2 -relief raised
set entryone ""
set entrytwo ""
label .main.inner.alabel -text "label"
pack .main.inner.alabel -in .main.inner
update
pack .main.inner -in .main -padx [expr ([expr [.main cget -width] - [winfo width .main.inner]] / 2)] -padx [expr ([expr [.main cget -height] - [winfo height .main.inner]] / 2)]
BUT, the winfo procedures both return "1" as the width/height of the .main.inner frame, even after i explicitly call "update" -- also, when i tried to use reqwidth/reqheight instead of height/width i still got "1" as the value...
What am i doing wrong?
Thanks in advance