Re: signals for line numbers in statusbar



On Sat, 18 May 2002 09:33:57 -0400
"Havoc Pennington" <hp redhat com> wrote:

I want to show the current line number of the "insert" mark from the gtk-2
text widget. Which signals should I use to update the number? The
"move-cursor" seems to be the most appropriate, but it is not emitted when
the user uses the mouse to change the line, or if the user just hits the
enter button. Any ideas?
"move_cursor" is just a keybinding signal.

You want mark_set or whatever on GtkTextBuffer, and compare the mark
to gtk_text_buffer_get_insert_mark().

the "mark-set" signal is not emitted if I change the cursor position, so
I need a different signal.

One solution is to bind to "key-release-event" and to
"button-release-event", but this does not work in the case you hold one of
the cursor keys to scroll to a line, the line number is not updated
then... So I need something else... A "cursor-position-changed" signal.....

thanks,
        Olivier

Attachment: pgpnpyV6sFVxH.pgp
Description: PGP signature



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