Home > Archive > PerlTk > September 2007 > HList how to disable it
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
HList how to disable it
|
|
| Petr Vileta 2007-08-31, 4:56 am |
| I use HList in my script and for some reason I need to disable this widget
but leave to stay visible. I mean some like Entry option -state =>
'disabled'. Is it possible?
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
| |
| smallpond 2007-08-31, 7:53 pm |
| On Aug 31, 1:11 am, "Petr Vileta" <sto...@practisoft.cz> wrote:
> I use HList in my script and for some reason I need to disable this widget
> but leave to stay visible. I mean some like Entry option -state =>
> 'disabled'. Is it possible?
> --
>
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your mail
> from another non-spammer site please.)
The actions performed by an HList are done with class bindings
(ClassInit call
in HList.pm). If you only use one HList in your program, you could
write your
own routine to turn these on and off, but it would affect all HLists
if you
had more than one.
A less hackish way might be to make your own widget derived from HList
which
adds an enable/disable configure parameter.
--S
| |
|
|
| Petr Vileta 2007-09-05, 7:03 pm |
| Pit wrote:
> you can disable every several entry in HList
Hmm, I have thousands of text style entries in HList ;-) I'm thinking why
HList have not -state option when alll other "interactive" widgets have it.
Say Entry, NumEntry, Button, Radiobutton, Checkbox etc.
Think you is possible to derive HList and add -state option to my own
widget? But how to do it?
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
| |
| Slaven Rezic 2007-09-16, 7:07 pm |
| "Petr Vileta" <stoupa@practisoft.cz> writes:
> Pit wrote:
> Hmm, I have thousands of text style entries in HList ;-) I'm thinking
> why HList have not -state option when alll other "interactive" widgets
> have it. Say Entry, NumEntry, Button, Radiobutton, Checkbox etc.
> Think you is possible to derive HList and add -state option to my own
> widget? But how to do it?
One way to make any widget not respond to events is:
$widget->bindtags([])
If you want to make the widget responding again, then you have to save
the old bindtags and assign this list again using bindtags().
For more advanced usage of bindtags you can look at the source code of
Busy and Unbusy (see Tk/Widget.pm). If you're on X11, then you can
also take a look at Tk::InputO.
Regards,
Slaven
--
Slaven Rezic - slaven <at> rezic <dot> de
Tired of using file selectors? Real programmers use the TAB key for
completion and not for jumping around. Try
http://search.cpan.org/search?mode=...y=Tk::PathEntry
|
|
|
|
|