Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TkTable Parent Widget Selection

Status
Not open for further replies.

mbitzko

Programmer
Apr 5, 2005
13
US
I am trying to attach a TkTable to a different parent other than the top level widget. Specifically, I would like the TkTable to be attached to a page (Blank Page) within a TabeNoteBook widget. The TabNoteBook widget is created as follows, followed by the attachment of the TkTable widget. I am using the pack to avoid the grid/pack conflict of widget management. How do you attach the TkTable widget to the desired (page) widget?

iwidgets::tabnotebook .tnb \
-width 6i -height 2.0i -tabpos n
# pack .tnb -padx 4 -pady 4 -expand true -side right -side left -fill x

# Page numer 1
set page [.tnb add -label "Part Info"]

array set table {
rows 100
cols 12
table .table
}

set t $table(table)
table $t \
-rows $table(rows) \
-cols $table(cols) \
-cache 1 \
-titlerows 1 \
-titlecols 1 \
-yscrollcommand { .tsy set } \
-xscrollcommand { .tsx set } \
-width 5 -height 5 \
-coltagcommand colorize \
-flashmode on \
-selectmode extended \
-colstretch unset \
-rowstretch unset \
-validate yes \
-vcmd {if {![%W tag includes title %C]} { validate %c %S } }

scrollbar .tsy -command [list $t yview]
scrollbar .tsx -command [list $t xview] -orient horizontal

pack .tsy -expand false -fill y -side left -side right
pack .tsx -expand false -fill x -side top -side bottom
pack .table -expand true -side top -side bottom -fill both
pack .tnb -expand false -side top -side bottom -fill both


 
In this case, wouldn't it be table .tnb.$t ...?

_________________
Bob Rashkin
rrashkin@csc.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top