From: Batox on
Some cells of my tablelist contain filenames. When the user clicks on
them, I want to display a file selector box and let him choose a file.
The following code nearly does the job, it accepts the chosen file
only if the user changes something before editing ends. Can I somehow
manually set the "dirty" flag for the temporary input widget?

package require tablelist

proc StartEdit {jl r c v} {
return [tk_getOpenFile]
}


tablelist::tablelist .tl -columns {0 Filename} -editstartcommand
StartEdit
..tl columnconfigure 0 -editable true
..tl insert end -
..tl insert end -

pack .tl
From: Csaba Nemethi on
Am 01.08.2010 11:17, schrieb Batox:
> Some cells of my tablelist contain filenames. When the user clicks on
> them, I want to display a file selector box and let him choose a file.
> The following code nearly does the job, it accepts the chosen file
> only if the user changes something before editing ends. Can I somehow
> manually set the "dirty" flag for the temporary input widget?
>
> package require tablelist
>
> proc StartEdit {jl r c v} {
> return [tk_getOpenFile]
> }
>
>
> tablelist::tablelist .tl -columns {0 Filename} -editstartcommand
> StartEdit
> .tl columnconfigure 0 -editable true
> .tl insert end -
> .tl insert end -
>
> pack .tl

Set the -forceeditendcommand to 1/yes/true/on.

I must admit that this feature is not clearly described in the
documentation. I will extend the description of the
-forceeditendcommand option for the next release.

--
Csaba Nemethi http://www.nemethi.de mailto:csaba.nemethi(a)t-online.de