Re: Stop text view to scroll on pageup/down (Gabriele Greco)
On Tue, Oct 7, 2008 at 4:14 PM, Garth's KidStuff [EMAIL PROTECTED]wrote: Thanks for the reply! the scrolledwindow but without results: g_signal_connect(sw, key-press-event, (GCallback)eat_pageupdown, NULL); I just asked a very similar question a few days ago on the list and Murray was kind enough to point out that I needed to connect my signal *before* the regular signal handler (as opposed to after, which is the default). In gtkmm, this was easy as the connect function has a parameter for that very purpose. I don't see how to so so here. Sorry :( g_signal_connect_before doesn't exists because the documentation of g_signal_connect says: Connects a GCallbackhttp://library.gnome.org/devel/gobject/2.6/gobject-Closures.html#GCallbackfunction to a signal for a particular object. The handler will be called before the default handler of the signal. As far as I've seen gtkmm there is no connect_before() also there, but there is a boolean flag after... Anyway it seems that none of the widget involved (textview, scrolledwindow, verticalscrollbar) receive key-press-event nor key-release-event so connecting it before or after the default handler will not change the behaviour... -- Bye, Gabry ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Stop text view to scroll on pageup/down (Gabriele Greco)
I've assigned a global meaning to the PageUp/Down keys in a application and I catch them with a key snooper. The keys are catched and the action performed, but if the window contains a textview also the textview contents are scrolled, so I tried to catch the keys in the textview, and then in the scrolledwindow but without results: g_signal_connect(sw, key-press-event, (GCallback)eat_pageupdown, NULL); I just asked a very similar question a few days ago on the list and Murray was kind enough to point out that I needed to connect my signal *before* the regular signal handler (as opposed to after, which is the default). In gtkmm, this was easy as the connect function has a parameter for that very purpose. I don't see how to so so here. Sorry :( -- Garth Upshaw Garth's KidStuff ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Stop text view to scroll on pageup/down
I've assigned a global meaning to the PageUp/Down keys in a application and I catch them with a key snooper. The keys are catched and the action performed, but if the window contains a textview also the textview contents are scrolled, so I tried to catch the keys in the textview, and then in the scrolledwindow but without results: g_signal_connect(sw, key-press-event, (GCallback)eat_pageupdown, NULL); g_signal_connect(tv, key-press-event, (GCallback)eat_pageupdown, NULL); g_signal_connect(sw, key-release-event, (GCallback)eat_pageupdown, NULL); g_signal_connect(tv, key-release-event, (GCallback)eat_pageupdown, NULL); Where eat_pageupdown is: gboolean eat_pageupdown(GtkWidget *widget, GdkEventKey *event, gpointer user_data) { return (event-keyval == GDK_Page_Up || event-keyval == GDK_Page_Down); } Obviously this doesn't work... So here is my question: what is the correct way to override the standard paging keys for a TextView? -- Bye, Gabry ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list