Re: is there a signal for typing at bottom of window?

2018-09-25 Thread Joël Krähemann via gtk-app-devel-list
Hi again, For sure you should probably use: g_signal_connect_after(your_text_buffer, "changed", G_CALLBACK(your_text_buffer_changed_callback), your_data); and YOUR_DATA(your_data) just casts to your pointer to a struct or object containing some information: struct _YourData{ gint

Re: is there a signal for typing at bottom of window?

2018-09-25 Thread Joël Krähemann via gtk-app-devel-list
Hi, g_object_get(your_text_view, "buffer", _text_buffer, NULL); g_signal_connect(your_text_buffer, "changed", G_CALLBACK(your_text_buffer_changed_callback), your_data); void your_text_buffer_changed_callback(GtkTextBuffer *your_text_buffer, gpointer your_data) { gint line_count;

Re: is there a signal for typing at bottom of window?

2018-09-25 Thread Doug McCasland
Eric, thanks for the ideas! I tried a bunch of things to distinguish the callbacks, but it got too complicated. Checking for a different line number is a clever idea, but PgUp and PgDown also move the cursor which changes the line number. Similar problems for tracking the char offset in the

Re: is there a signal for typing at bottom of window?

2018-09-25 Thread Eric Cashon via gtk-app-devel-list
Hi Doug, Try getting the vertical adjustment of the scrolled window and connect to "value-changed". See if that will work. Something like ... static void value_changed(GtkAdjustment *v_adjust, gpointer user_data)   {   } ... GtkWidget *scroll=gtk_scrolled_window_new(NULL, NULL);