diff options
author | Damon Chaplin <damon@helixcode.com> | 2000-05-18 08:32:18 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2000-05-18 08:32:18 +0800 |
commit | 844e27e365aa00a3d49055d316e5848c03118895 (patch) | |
tree | 7b6bd1177059f918201ae543a2bc9071daba94cb /widgets/shortcut-bar/test-shortcut-bar.c | |
parent | 879ec8920b51709cf762cbb6785f8f321da55b2d (diff) | |
download | gsoc2013-evolution-844e27e365aa00a3d49055d316e5848c03118895.tar.gz gsoc2013-evolution-844e27e365aa00a3d49055d316e5848c03118895.tar.zst gsoc2013-evolution-844e27e365aa00a3d49055d316e5848c03118895.zip |
new signals "added_item", "removed_item", "added_group", "removed_group".
2000-05-18 Damon Chaplin <damon@helixcode.com>
* e-shortcut-bar.[hc]: new signals "added_item", "removed_item",
"added_group", "removed_group". Note that the removed signals are
emitted just before the item/group is actually removed.
* test-shortcut-bar.c: updated to test the new signals, and ref'ed
the pixbufs in the icon callback.
svn path=/trunk/; revision=3111
Diffstat (limited to 'widgets/shortcut-bar/test-shortcut-bar.c')
-rw-r--r-- | widgets/shortcut-bar/test-shortcut-bar.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/widgets/shortcut-bar/test-shortcut-bar.c b/widgets/shortcut-bar/test-shortcut-bar.c index abdccddeb1..5d9ae700f3 100644 --- a/widgets/shortcut-bar/test-shortcut-bar.c +++ b/widgets/shortcut-bar/test-shortcut-bar.c @@ -84,6 +84,16 @@ static void on_set_group_button_clicked (GtkWidget *button, EShortcutBar *shortcut_bar); static void on_set_group_button_no_animation_clicked (GtkWidget *button, EShortcutBar *shortcut_bar); +static void on_item_added (EShortcutBar *shortcut_bar, + gint group_num, + gint item_num); +static void on_item_removed (EShortcutBar *shortcut_bar, + gint group_num, + gint item_num); +static void on_group_added (EShortcutBar *shortcut_bar, + gint group_num); +static void on_group_removed (EShortcutBar *shortcut_bar, + gint group_num); int main (int argc, char *argv[]) @@ -115,6 +125,15 @@ main (int argc, char *argv[]) icon_callback, NULL); + gtk_signal_connect (GTK_OBJECT (shortcut_bar), "item_added", + GTK_SIGNAL_FUNC (on_item_added), NULL); + gtk_signal_connect (GTK_OBJECT (shortcut_bar), "item_removed", + GTK_SIGNAL_FUNC (on_item_removed), NULL); + gtk_signal_connect (GTK_OBJECT (shortcut_bar), "group_added", + GTK_SIGNAL_FUNC (on_group_added), NULL); + gtk_signal_connect (GTK_OBJECT (shortcut_bar), "group_removed", + GTK_SIGNAL_FUNC (on_group_removed), NULL); + #if 0 gtk_container_set_border_width (GTK_CONTAINER (shortcut_bar), 4); #endif @@ -190,6 +209,7 @@ icon_callback (EShortcutBar *shortcut_bar, for (i = 0; i < NUM_SHORTCUT_TYPES; i++) { if (!strncmp (url, shortcut_types[i], strlen (shortcut_types[i]))) { + gdk_pixbuf_ref (icon_pixbufs[i]); return icon_pixbufs[i]; } } @@ -559,3 +579,37 @@ on_move_button_clicked (GtkWidget *button, e_group_bar_reorder_group (E_GROUP_BAR (shortcut_bar), 0, 3); } + + +static void +on_item_added (EShortcutBar *shortcut_bar, + gint group_num, + gint item_num) +{ + g_print ("In on_item_added Group:%i Item:%i\n", group_num, item_num); +} + + +static void +on_item_removed (EShortcutBar *shortcut_bar, + gint group_num, + gint item_num) +{ + g_print ("In on_item_removed Group:%i Item:%i\n", group_num, item_num); +} + + +static void +on_group_added (EShortcutBar *shortcut_bar, + gint group_num) +{ + g_print ("In on_group_added Group:%i\n", group_num); +} + + +static void +on_group_removed (EShortcutBar *shortcut_bar, + gint group_num) +{ + g_print ("In on_group_removed Group:%i\n", group_num); +} |