diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-09-16 19:43:36 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-09-16 19:43:36 +0200 |
commit | a6982bcc3bf7dce09be61eb09fba946ef5c92b30 (patch) | |
tree | bc9805f1a4cd95ccb043ccd89cfaf4f559626f94 /fastiv.c | |
parent | 57ac392431bf8bf7c32e7204771aca296096672b (diff) | |
download | fiv-a6982bcc3bf7dce09be61eb09fba946ef5c92b30.tar.gz fiv-a6982bcc3bf7dce09be61eb09fba946ef5c92b30.tar.xz fiv-a6982bcc3bf7dce09be61eb09fba946ef5c92b30.zip |
Make <q> and <Escape> quit, update README
Diffstat (limited to 'fastiv.c')
-rw-r--r-- | fastiv.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -84,6 +84,14 @@ main(int argc, char *argv[]) g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); gtk_container_add(GTK_CONTAINER(window), view); + // The references to closures are initially floating and sunk on connect. + GtkAccelGroup *accel_group = gtk_accel_group_new(); + gtk_accel_group_connect(accel_group, GDK_KEY_Escape, 0, 0, + g_cclosure_new(G_CALLBACK(gtk_main_quit), NULL, NULL)); + gtk_accel_group_connect(accel_group, GDK_KEY_q, 0, 0, + g_cclosure_new(G_CALLBACK(gtk_main_quit), NULL, NULL)); + gtk_window_add_accel_group(GTK_WINDOW(window), accel_group); + // TODO(p): Load directory entries, store in `g`. // - Only when there's just one filename. // - stat() it if it's a dictionary or a filename; |