diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-02 15:01:34 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-02 15:01:34 (EDT) |
commit | b8e8613a6d680f229d61acd8c1199d0c6aa565d5 (patch) | |
tree | 79668340ea1de3f3f77a1fd140ca7cad4b714aac | |
parent | 57c12d9f78003610af9ba34171107a2c1309c292 (diff) | |
download | marquee-b8e8613a6d680f229d61acd8c1199d0c6aa565d5.zip marquee-b8e8613a6d680f229d61acd8c1199d0c6aa565d5.tar.gz marquee-b8e8613a6d680f229d61acd8c1199d0c6aa565d5.tar.bz2 |
MqTabLabel: Improve signal connection macro
-rw-r--r-- | src/tab-label.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/tab-label.c b/src/tab-label.c index 5e7cc32..1971d50 100644 --- a/src/tab-label.c +++ b/src/tab-label.c @@ -101,7 +101,8 @@ new_window_clicked_cb(GtkWidget G_GNUC_UNUSED *button, MqTabLabel *tab_label) buttons[Y * BUTTON_COLS + X], X, Y, 1, 1); \ } G_STMT_END #define CLICKED_CB(Y, X, CB) \ - g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", CB, tab_label) + g_signal_connect(buttons[Y * BUTTON_COLS + X], "clicked", \ + G_CALLBACK(CB), tab_label) static void create_tab_popover(GtkWidget *widget, MqTabLabel *tab_label) @@ -122,12 +123,12 @@ create_tab_popover(GtkWidget *widget, MqTabLabel *tab_label) NEW_BUTTON(1, 1, "window-new", "New window"); NEW_BUTTON(1, 2, "edit-undo", "Undo close tab"); - CLICKED_CB(0, 0, G_CALLBACK(reload_tab_clicked_cb)); + CLICKED_CB(0, 0, reload_tab_clicked_cb); /* TODO: 0, 1: Duplicate tab */ /* TODO: 0, 2: Move tab to new window */ - CLICKED_CB(0, 3, G_CALLBACK(close_clicked_cb)); - CLICKED_CB(1, 0, G_CALLBACK(new_tab_clicked_cb)); - CLICKED_CB(1, 1, G_CALLBACK(new_window_clicked_cb)); + CLICKED_CB(0, 3, close_clicked_cb); + CLICKED_CB(1, 0, new_tab_clicked_cb); + CLICKED_CB(1, 1, new_window_clicked_cb); /* TODO: 1, 2: Undo close tab */ /* Set up the popover. */ |