On Thu, 17 Apr 1997, Clemens Hintze wrote:
> I wonder if vtcl cannot deal with unmanaged widgets correctly? What means that:
> suppose I have a surface with a checkbox (called .top1.cb1) and two buttons
> (.top1.b1 and .top.b2 for example). I use the packer throughout the whole
> example.
>
> Now I want to hide (pack forget) both buttons. If for example the .top1.cb1 is
> checked, then the button .tp.b1 should appear. If it is not checked, the button
> .top.b2 should appear, and the other one should vanish, etc.
>
> So I have created one checkbox and two buttons, set the command of the
> checkbox to the right pack command (check, only ...b1 visible; not check, only
> ...b2 visible). Then I have 'hide' the two buttons (they vanis from the
> toplevel, but are visible via widget tree). Afterwards I have test the app and
> all works fine.
Another common way to handle this is to set the buttons to be disabled,
rather than to hide them completely. When they're disabled, the button
text is set to be light grey. You've surely seen this method in commercial
and free software.
Your checkbutton command just needs to be something like:
$widget(b1) config -state disabled
$widget(b2) config -state disabled
and then "-state normal" to turn them back on again.
I have a (manual) application where I destroy and recreate widgets. It's
irritating when it causes the packer to resize the whole window every time
these parts of the window are removed and replaced. This doesn't
necessarilly happen; it depends on the layout and the pack options.
...RickM...