GUI toolkit selection for a text editor widget

Cameron Laird claird at lairds.com
Sat Nov 8 07:00:10 EST 2003


In article <Pine.SOL.4.44.0311071940040.1640-100000 at albinoni.EECS.Berkeley.EDU>,
Srinath Avadhanula  <srinathava_news at yahoo.com> wrote:
			.
			.
			.
>3. Tkinter: I looked briefly at Tkinter and the Text widget looked very
>   impressive indeed! It looks like the way it highlights text is even
>   more powerful than Vim in that each character (or range) has multiple
>   "tags" associated with it and the most recent tag takes precedence.
>   This looks like something which might be very handy. It even supports
>   inserting bitmaps etc. All in all, very neat looking.
>
>   But there seems to be some limitations:
>   1. How do I recognize control key inputs? I tried
>          self.bind('<Key>', function)
>      but how to find out if CTRL-a has been pressed in the function. When
>      I ran a simple app, event.char reports 'a' when I press CTRL-A. So
>      does event.keysym and event.keycode... wxPython has something called
>      event.ControlDown() for keyEvents...
>
>   2. There seems to be a problem with displaying unicode which Text
>      suffers from too :( The problem is not as severe as the one
>      wxStyledTextCtrl suffers from and it looks like it can be "lived
>      with". When moving over certain "composing character" strings in
>      unicode, the caret seems to move _between_ the characters. Ideally,
>      each sequence of composing characters would be considered a single
>      "glyph"... I will elaborate if someone needs clarification.
>
>   3. Although the Text widget itself is powerful, from what I gather in
>      this newsgroup and on the web, Tkinter does not provide things like
>      a tree control widget which might be essential later on. This looks
>      like something which can be worked around, because idle, the editor
>      provided with Python 2.3 seems to have all these things constructed
>      using the basic primitives...
>
>    Infact, I am wondering whether I should just modify Idle to accept Vi
>    style key-bindinds...
			.
			.
			.
Tcl/Tk experts make the Text widget do remarkable things.
I'm sure they've already implemented vi bindings at least
once <URL: http://wiki.tcl.tk/ctext >.  Your questions
would be welcome in comp.lang.tcl, if you don't find
satisfaction elsewhere.
1.  While I don't have access to a Tkinter just
    now, and so can't usefully exercise code
    examples, <URL: http://wiki.tcl.tk/keysyms >
    should model a solution to your keysym
    difficulties.
3.  You'll want to read <URL: http://wiki.tcl.tk/tree >.
-- 

Cameron Laird <claird at phaseit.net>
Business:  http://www.Phaseit.net




More information about the Python-list mailing list