Re: How to get path?



On May 17, 12:16 am, ZB <zbREMOVE_THIS@xxxxxxxxxxxxxxxxxxxx> wrote:
Dnia 16.05.2008 Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx> napisa³/a:

As you can guess, this callback flips the bit at the given pos in the
list help by ::gl, and also updates the text displayed in the
corresponding button.

The list was *just example*. Yes, I'm operating the list variable - but not
by setting/clearing the bits.

What the heck does this have to do with your widget ident issue ?


The way I'm operating would be more comfortable, if I could recognize the
button clicked. And there are some "workarounds" - none of which is neither
natural, nor elegant.

OK. You seem to find inelegant the idea of recording the widget's name
*with* the callback.
Strange taste, I would say.
So you want syntactic sugar ? We can deliver:

proc attach_command_remembering_self {w cmd} {
$w configure -command [string map [list %SELF% $w] $cmd]
}

foreach w {.foo .bar .baz .gnu .gnats} {
attach_command_remembering_self $w {clickme %SELF%}
}

Do you see why it is better to do this in the language, at the data
handling level, than in the GUI package Tk ?

-Alex
.