I am having some difficulties building a simple window with a
GtkText in it -- the intended functionality is basically that of
an "xterm", and the window itself is the "console" window for my
application -- it allows me to interactively query the state of
GUI objects and so forth.
I've got a "GUIConsole" class descended from the Python "code"
module's "InteractiveConsole", with an embedded GtkText widget.
The "insert-text" signal is tied to a routine that passes the
text on to the parser, and this same routine writes out the appropriate
prompt to the GtkText.
The problem is that, when the prompt gets written out, the input
cursor doesn't move, so that new text input by the user appears
at the start of the line, pushing the prompt along ahead of it.
It appears, from looking at the API, that there is a "point"
(as in "set_point" and "get_point") which is known to the GtkText,
and a "position" known to the parent GtkEditable, but neither of
these is the text insertion point that is used when keystrokes are
received by the window. It seems like the only way to move *that*
cursor is by mouse-clicks on the window itself.
Is there a way to get control of this cursor, or a better way to insert
text such that the cursor gets moved? I don't mind if the user moves
it away with the mouse, but in the absence of user intervention, it
should appear after the prompt.
My alternative, at this point, is to use a big stack of GtkLabel's
and a GtkEntry, instead of a GtkText. Likely to work, but necessary?
I'm running Python2.1 and pygtk0.6.8, Gtk 1.2, on Linux.
-- Andrew Reid
[EMAIL PROTECTED]
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/