Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Possible bug in Tk::Text

by converter (Priest)
on Jun 09, 2003 at 20:06 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://264445]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-18 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found