Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Possible bug in Tk::Text

by converter (Priest)
on Jun 09, 2003 at 20:06 UTC ( #264445=note: print w/ replies, xml ) Need Help??


in reply to Possible bug in Tk::Text

The Tk::Text POD documents this behavior:

Name: state Class: State Switch: -state Specifies one of two states for the text: normal or disabl +ed. If the text is disabled then characters may not be inserted or + deleted and no insertion cursor will be displayed, even if the inpu +t focus is in the widget.

While this may seem inconsistent when compared with the behavior of other widget classes, I've always assumed there was a good reason for it. If you want a Text widget that can't be modified, but that doesn't require toggling -state, you can always use Tk::ROText, which replaces the bindings that are normally used to modify the text with noops.


Comment on Re: Possible bug in Tk::Text
Select or Download Code
Re: Re: Possible bug in Tk::Text
by zakb (Pilgrim) on Jun 10, 2003 at 07:47 UTC

    I'd missed that in the POD. However, the POD for Tk::Entry says exactly the same, word for word, but Entry allows the text to be changed programmatically no matter what the state. The key difference is between what the user is allowed to do (which is what state controls) and what the programmer is allowed to do.

    Tk::ROText won't work for me, I need the text to be read/write for the user, just not all the time.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://264445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-09-23 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (239 votes), past polls