g_signal_handler_block(win->widget, win->pager_keypress_handler);
}
+void
+pager_on_clicked(GtkButton *pager, winid_t win)
+{
+ GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment( GTK_SCROLLED_WINDOW(win->scrolledwindow) );
+ double upper = gtk_adjustment_get_upper(adj);
+ gtk_adjustment_set_value(adj, upper);
+}
+
/* When the user scrolls up in a textbuffer, start paging. */
void
pager_after_adjustment_changed(GtkAdjustment *adj, winid_t win)
start_paging(win);
else if(scroll_distance == 0 && win->currently_paging)
stop_paging(win);
-
- /* Refresh the widget so that any extra "more" prompts disappear */
- gtk_widget_queue_draw(win->widget);
}
/* Handle key press events in the textview while paging is active */
#include "glk.h"
#include "window.h"
-G_GNUC_INTERNAL gboolean pager_on_draw(GtkTextView *textview, cairo_t *cr, winid_t win);
+G_GNUC_INTERNAL void pager_on_clicked(GtkButton *pager, winid_t win);
G_GNUC_INTERNAL gboolean pager_on_key_press_event(GtkTextView *textview, GdkEventKey *event, winid_t win);
G_GNUC_INTERNAL void pager_after_adjustment_changed(GtkAdjustment *adj, winid_t win);
G_GNUC_INTERNAL void pager_after_size_allocate(GtkTextView *textview, GdkRectangle *allocation, winid_t win);
g_signal_handler_block(textview, win->pager_keypress_handler);
GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrolledwindow));
win->pager_adjustment_handler = g_signal_connect_after(adj, "value-changed", G_CALLBACK(pager_after_adjustment_changed), win);
+ g_signal_connect(pager, "clicked", G_CALLBACK(pager_on_clicked), win);
/* Char and line input */
win->char_input_keypress_handler = g_signal_connect( textview, "key-press-event", G_CALLBACK(on_char_input_key_press_event), win );