Get_iter_at_cursor?

Hi there, again me :wink: another problem

I would need a method such as:
get_iter_at_cursor
which gives back the iter at the current cursor.

I have looked but found no easy way to find out where the
cursor is located (+the iter it has)

My problem right now:

start_pos = buffer.get_iter_at_line(3)
end_pos = buffer.get_iter_at_line(20)
buffer.delete( start_pos, end_pos )

This snippet will/should delete lines 3-20.
However the first one for start_pos should be something like
this instead:

start_pos = buffer.get_iter_at_cursor

So that I could delete all rows up to a specified number
beginning with the cursor.

Does anyone know of a workaround at least?

=

–
Powered by Outblaze


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

On Sat, Apr 21, 2007 at 02:17:37AM +0100, Roebe XXX wrote:

Hi there, again me :wink: another problem

I would need a method such as:
get_iter_at_cursor
which gives back the iter at the current cursor.

The way you do this with TextBuffer is by grabbing the mark named
β€œinsert” and using that. See the attached script that prints the
character under the cursor every second.

hth,

-pete