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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> 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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
widget
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.
> 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.