Re: Still some question about row & column number. (Re: How to get the row & column number of cursor in GtkTextView?)



Thank you,

  I have found the solution of my question in gtk-demo examples. The 
"Application main window" example gives quite acurate answer:
>>>>>>
  g_signal_connect_object (buffer, "changed",G_CALLBACK (update_statusbar),                               
statusbar,0);
  g_signal_connect_object (buffer,"mark_set", /* cursor moved */, G_CALLBACK 
(mark_set_callback),statusbar,0);
<<<<<<
And in callbacks functions:

  count = gtk_text_buffer_get_char_count (buffer);
  gtk_text_buffer_get_iter_at_mark (buffer,&iter,gtk_text_buffer_get_insert 
(buffer));
  row = gtk_text_iter_get_line (&iter);
  col = gtk_text_iter_get_line_offset (&iter);

  Thank you very much.
  Yours,
  mili


ÔÚ  07:47£¬ÄúдµÀ£º
> > To: gtk-list gnome org
> > Subject: Still some question about row & column number. (Re: How to get
> > the
>
> row & column number of cursor in GtkTextView?)
>
> > User-Agent: KMail/1.4.1
> > Cc: Padraig Obriain Sun COM
> > MIME-Version: 1.0
> > Content-Transfer-Encoding: 8bit
> > X-MIME-Autoconverted: from quoted-printable to 8bit by
>
> dub-mail1.Ireland.Sun.COM id g7PGRVW09583




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