Re: [gtk-list] movement functions in GtkText



>>>>> "ME" == Michael Elkins <Michael_Elkins@nai.com> writes:

 ME> Why are all of the movement functions in GtkText not exported?
 ME> There doesn't seem to be a way other than calculating the
 ME> position of end-of-line, for example, yourself and then calling
 ME> gtk_editable_set_position().  I note that in the gtktext.c source
 ME> file there is a comment which says "to be removed" above all the
 ME> movement functions.

I think this is due to the comming re-implementation of the text
widget, am I right?

Anyway, you can hack this by using movements from the editable
widget.  You cannot get to those either for some reason (I think
_this_ is broken, but there may be some hidden reason for this).
Anyway you can use signals like this

  gtk_signal_emit_by_name (GTK_OBJECT (text), "move_to_column", 0);

to get to the start of a line, and 

  gtk_signal_emit_by_name (GTK_OBJECT (text), "move_to_column", -1);

to move to the end of line.

This will call the function

  void (* move_to_column)  (GtkEditable *editable,
			    gint         row);

from the editable class, which is redefined

  editable_class->move_to_column = gtk_text_move_to_column;

in the text widget, so this should give you the movement you want.
Similar for most of the 'movement' and 'kill' functions.

If anyone knows an easier way of doing this, I'd like to know as well.

        /mailund



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]