Re: tablelist: possible to have embedded window that grows with the column?
- From: Csaba Nemethi <csaba.nemethi@xxxxxxxxxxx>
- Date: Tue, 30 Oct 2007 20:44:01 +0100
Bryan Oakley schrieb:
Is it possible to embed a window in a tablelist cell and have that widget grow and shrink as the column is resized either dynamically or as a column is automatically stretched? I've tried a few obvious things such as binding to <Configure> but whatever width I set my widget to, it always snaps back to the original width.
It seems I can adjust the width of both the widget and the parent to the window, but that depends on the internal state of the tablelist, which I'd rather not do. I'm wondering if I'm just missing something in the sea of options available to me.
Here's code that illustrates the problem. What I desire is to have the red and blue frames grow and shrink as you resize the window but they do not.
package require Tk
package require Tablelist
proc main {} {
label .status -bd 1 -relief raised
pack .status -side bottom -fill x
tablelist::tablelist .t \
-columns {-32 "" left 0 Stretchable left -32 "" left} \
-stretch 1
.t insert end {{} {}}
.t cellconfigure end,1 -window {createWindow red}
.t insert end {{} {}}
.t cellconfigure end,1 -window {createWindow blue}
pack .t -side top -fill both -expand true
bind .t <Configure> resize
}
proc resize {} {
set width [.t columnwidth 1 -total]
.status configure -text "resetting width to $width"
foreach row {0 1} {
set window [.t windowpath $row,1]
$window configure -width $width
}
}
proc createWindow {color t row col path} {
set width [.t columnwidth 1 -total]
frame $path -width $width -height 8 -background $color
}
main
Bryan,
Currently Tablelist doesn't support embedded widgets of dynamic width. You are not the first person asking for this feature, which is one of the many items on my ever-growing TODO list. Unfortunately, I have been awfully busy for several months now, and I don't see any chance to get the necessary leisure time before February 2008. :-(
--
Csaba Nemethi http://www.nemethi.de mailto:csaba.nemethi@xxxxxxxxxxx
.
- Follow-Ups:
- Re: tablelist: possible to have embedded window that grows with the column?
- From: Bryan Oakley
- Re: tablelist: possible to have embedded window that grows with the column?
- References:
- tablelist: possible to have embedded window that grows with the column?
- From: Bryan Oakley
- tablelist: possible to have embedded window that grows with the column?
- Prev by Date: Re: WebServices for Tcl 1.0.8 availiable
- Next by Date: Re: Expect spawns on 64-bit Windows
- Previous by thread: tablelist: possible to have embedded window that grows with the column?
- Next by thread: Re: tablelist: possible to have embedded window that grows with the column?
- Index(es):
Relevant Pages
|