I know with CountGadgetItems() I can get the Number of rows of my Editorgadget.
But how can I set the Cursor after the last Character? I find the GTK-Signal
move_to_row. How can i send this signal?
Can anyone send the code?
TIA
Set Position in EditorGadget
Do you want to put it after the last character of a specific line, or just at the end of the gadget ?
There is the gtk_editable_set_position_() command. If you want to set the cursor
after a specific line, you have to get the whole text into a buffer, scan through
it to get the actual character index of where you want to put the cursor and then
call the above function.
Putting the cursor at the end of everything is simpler. A PB EditorGadget is
both a GtkEditable and a GtkText (because GtkText is an extension of GtkEditable),
so you can mix both types of functions.
So it can be done like this:
There is the gtk_editable_set_position_() command. If you want to set the cursor
after a specific line, you have to get the whole text into a buffer, scan through
it to get the actual character index of where you want to put the cursor and then
call the above function.
Putting the cursor at the end of everything is simpler. A PB EditorGadget is
both a GtkEditable and a GtkText (because GtkText is an extension of GtkEditable),
so you can mix both types of functions.
So it can be done like this:
Code: Select all
GadgetID = GadgetID(#Editor)
length = gtk_text_get_length_(GadgetID)
gtk_editable_set_position_(GadgetID, length)
quidquid Latine dictum sit altum videtur