Tk Library Source Code

View Ticket
Login
Ticket UUID: 3480882
Title: new widget - read-only text
Type: RFE Version: None
Submitter: daapp Created on: 2012-01-28 11:44:55
Subsystem: tklib: request for new module Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Open Last Modified: 2012-02-24 17:56:51
Resolution: Closed By:
    Closed on:
Description:
widget::rotext - readonly text widget for tklib.
User Comments: daapp added on 2012-02-24 17:56:51:
> Your rotext seems to disable interactive editing (i.e. anything done
> through the bindings), and allow non-interactive (programmatic) editing. Is
> that right ?

Yes, you are right.

>
> Is this based per-chance on some code on the Tcler's Wiki
> (http://wiki.tcl.tk) ?
> If yes, that are the page numbers ?

I write this code myself, but idea is so simple, so may be wiki contains simular code.

>
> Note that an alternative way of doing a rotext is wrap around text and
> disable the 'insert' and 'delete' method, without touching the bindings .
> This will disable all editing, interactive and programmatic. The latter can
> then be restored by providing differently named methods for programmatic
> access.
>

I saw such alternative code on the Tcl wiki, but my idea was leave text api as is, just disable interactive editing. Example, in my application I have one text widget for code editing, one other text widget for viewing this code after some preprocessor. Also, I found this widget useful in some other situations.

P.S: may be it will be good to add my code  to widget::scrolledtext, but this at your discretion.

andreas_kupries added on 2012-02-23 02:08:32:
Some questions after reading the code:

Your rotext seems to disable interactive editing (i.e. anything done through the bindings), and allow non-interactive (programmatic) editing. Is that right ?

Is this based per-chance on some code on the Tcler's Wiki (http://wiki.tcl.tk) ?
If yes, that are the page numbers ?

Note that an alternative way of doing a rotext is wrap around text and disable the 'insert' and 'delete' method, without touching the bindings . This will disable all editing, interactive and programmatic. The latter can then be restored by providing differently named methods for programmatic access.

daapp added on 2012-01-28 18:44:57:

File Added - 434231: rotext-0.1.tm

Attachments: