aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/shortcut-bar/test-shortcut-bar.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-04-16 21:21:26 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-04-16 21:21:26 +0800
commit13a168017cd5b6d8907293a56732dc6f88ec4400 (patch)
tree235538aabba7939b2249750730b4632f13d0ca08 /widgets/shortcut-bar/test-shortcut-bar.c
parent23c29cbcf654883e1243f51adb4bfe3556477cff (diff)
downloadgsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.gz
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.bz2
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.lz
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.xz
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.tar.zst
gsoc2013-evolution-13a168017cd5b6d8907293a56732dc6f88ec4400.zip
added buttons to test moving/reordering groups.
2000-04-16 Damon Chaplin <damon@helixcode.com> * test-shortcut-bar.c: added buttons to test moving/reordering groups. * e-shortcut-bar.c (e_shortcut_bar_on_drag_end): new function to free the dragged name & URL when the drag is finished. * e-group-bar.c (e_group_bar_get_increment): fixed bug when distance was 0. Should just return 0. (e_group_bar_set_current_group_num): added animate option and finished. (e_group_bar_unmap): called e_group_bar_stop_all_animation(). (e_group_bar_reorder_group): finished. * e-icon-bar-text-item.[hc]: removed, since we now use EText. svn path=/trunk/; revision=2459
Diffstat (limited to 'widgets/shortcut-bar/test-shortcut-bar.c')
-rw-r--r--widgets/shortcut-bar/test-shortcut-bar.c66
1 files changed, 64 insertions, 2 deletions
diff --git a/widgets/shortcut-bar/test-shortcut-bar.c b/widgets/shortcut-bar/test-shortcut-bar.c
index 250704d227..6a62311638 100644
--- a/widgets/shortcut-bar/test-shortcut-bar.c
+++ b/widgets/shortcut-bar/test-shortcut-bar.c
@@ -76,11 +76,17 @@ static void rename_item (GtkWidget *menuitem,
EShortcutBar *shortcut_bar);
static void remove_item (GtkWidget *menuitem,
EShortcutBar *shortcut_bar);
+static void on_move_button_clicked (GtkWidget *button,
+ EShortcutBar *shortcut_bar);
+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);
int
main (int argc, char *argv[])
{
- GtkWidget *window, *hpaned, *shortcut_bar;
+ GtkWidget *window, *hpaned, *shortcut_bar, *vbox, *button;
gchar *pathname;
gint i;
@@ -113,13 +119,39 @@ main (int argc, char *argv[])
gtk_paned_set_position (GTK_PANED (hpaned), 100);
/*gtk_paned_set_gutter_size (GTK_PANED (hpaned), 12);*/
+ vbox = gtk_vbox_new (FALSE, 0);
+ gtk_paned_pack2 (GTK_PANED (hpaned), vbox, TRUE, TRUE);
+ gtk_widget_show (vbox);
+
+
main_label = gtk_label_new ("Main Application Window Goes Here");
- gtk_paned_pack2 (GTK_PANED (hpaned), main_label, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), main_label, TRUE, TRUE, 0);
gtk_widget_show (main_label);
gtk_signal_connect (GTK_OBJECT (main_label), "size_allocate",
GTK_SIGNAL_FUNC (on_main_label_size_allocate),
NULL);
+ button = gtk_button_new_with_label ("Move 1st group to 4th");
+ gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+ gtk_widget_show (button);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (on_move_button_clicked),
+ shortcut_bar);
+
+ button = gtk_button_new_with_label ("Set current group to 3rd");
+ gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+ gtk_widget_show (button);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (on_set_group_button_clicked),
+ shortcut_bar);
+
+ button = gtk_button_new_with_label ("Set current group to 5th (no animation)");
+ gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
+ gtk_widget_show (button);
+ gtk_signal_connect (GTK_OBJECT (button), "clicked",
+ GTK_SIGNAL_FUNC (on_set_group_button_no_animation_clicked),
+ shortcut_bar);
+
gtk_widget_pop_visual ();
gtk_widget_pop_colormap ();
@@ -493,3 +525,33 @@ remove_item (GtkWidget *menuitem,
}
+static void
+on_set_group_button_clicked (GtkWidget *button,
+ EShortcutBar *shortcut_bar)
+{
+ g_print ("In on_set_group_button_clicked\n");
+
+ e_group_bar_set_current_group_num (E_GROUP_BAR (shortcut_bar),
+ 2, FALSE);
+}
+
+
+static void
+on_set_group_button_no_animation_clicked (GtkWidget *button,
+ EShortcutBar *shortcut_bar)
+{
+ g_print ("In on_set_group_button_no_animation_clicked\n");
+
+ e_group_bar_set_current_group_num (E_GROUP_BAR (shortcut_bar),
+ 4, FALSE);
+}
+
+
+static void
+on_move_button_clicked (GtkWidget *button,
+ EShortcutBar *shortcut_bar)
+{
+ g_print ("In on_move_button_clicked\n");
+
+ e_group_bar_reorder_group (E_GROUP_BAR (shortcut_bar), 0, 3);
+}