viscal

cairo/gtk vi-like timeblocking calendar
git clone git://jb55.com/viscal
Log | Files | Refs | README | LICENSE

commit be21cf691ff458b448282c8d90587aba927dfa32
parent 8abba4245fe60879e1445d739691df7cb448fed0
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 30 Nov 2018 09:25:09 -0800

ui: redraw every 500ms

Diffstat:
Mviscal.c | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/viscal.c b/viscal.c @@ -2243,6 +2243,11 @@ static inline double rand_0to1() { return (double) rand() / RAND_MAX; } +static gboolean redraw_timer_handler(struct extra_data *data) { + gtk_widget_queue_draw(data->cal->widget); + return 1; +} + int main(int argc, char *argv[]) { @@ -2328,6 +2333,10 @@ int main(int argc, char *argv[]) cursor_pointer = gdk_cursor_new_from_name (display, "pointer"); cursor_default = gdk_cursor_new_from_name (display, "default"); + // redraw timer + g_timeout_add(500, (GSourceFunc)redraw_timer_handler, + (gpointer)&extra_data); + g_signal_connect(G_OBJECT(darea), "button-press-event", G_CALLBACK(on_press), (gpointer)&extra_data);