Speeking of OOish programming style:
Why don't you extend the widgets you use in a way, that they
provide a setState method, that turns their appearance and
state (if applicable) to your likes?
By the way: If you use a hash to store your widgets, you actually
_have_ a way to tag your controls. You just have to use appropriate
keys like ":tag1:tag2:actualKey:". Thus with a foreach-loop and a
simple regular expression or string index function, you are there.
If it has to be even more convenient, write your own OO-module,
that give you the special features that you want and hides all
the details.
Regards,
Gerhard
(bcc: Gerhard Petrowitsch/STN/SC/PHILIPS)
Subject: Re: Disabling a Scale widget
Rich Morin
Sent by:
.EDU
22-04-2003 00:21
Quote:
>I can't follow you. tagConfigure is only useful in the Text widget and
>itemconfigure in widgets which are composed by many smaller entities
>(which are *not* subwidgets), like Canvas, HList, in Tk804 also the
>plain Listbox. I don't see how the Scale widget fit into this
>scheme...
I have a window which has quite a few controls:
3 Button
4 Checkbutton
3 Optionmenu
3 Radiobutton
1 Scale
Initially, everything is disabled except for two of the Optionmenus.
As the user makes selections and pushes buttons, other controls get
enabled and disabled. Currently, I'm using a hash to store refs to
the widgets; this lets me walk through the hash to (en|dis)able the
controls, as appropriate.
If I could "tag" the controls, I could simply issue an itemconfigure
(or whatever) and change the status of a set of controls. This would
take less code on my part.
Quote:
>Traditionally disabling in Tk means "do not accept any input for this
>widget", hence it makes no sence for Label widgets. Do you mean a way
>to "hide" a label?
When a control is disabled, any black text on the control turns grey.
This is the case for Button, Checkbutton, Optionmenu, and Radiobutton
(and probably others). Unfortunately, the Labels that I'm putting
next to the Scale and Optionmenu cannot be "disabled", so I have to
find some other way to make them turn grey. Otherwise, I have some
black labels sitting next to disabled controls.
This isn't so bad in the case of the Optionmenu, because the text on
the widget turns grey. The slider, however, has no visible way of
showing that it is disabled. It just fails to respond to the mouse.
In short, I want the visual cues to be consistent, to reduce the
user's confusion and chance for error. It annoys me a bit that I
have to use a variety of APIs to get visually similar results.
-r
--
http://www.cfcl.com/rdm - my home page, resume, etc.
http://www.cfcl.com/Meta - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc - Prime Time Freeware's Darwin Collection
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the