diff options
author | Matthias Clasen <mclasen@redhat.com> | 2004-11-09 06:14:11 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-11-09 06:14:11 +0000 |
commit | dd3948538b956d2f22d71d2cacfe5bfbc16de35a (patch) | |
tree | b3cc786763864fbbe02aa1d1fe3d35e36ca05875 /tests | |
parent | 876fba5940e8b322dc2434f288fac440943e6065 (diff) | |
download | gtk+-dd3948538b956d2f22d71d2cacfe5bfbc16de35a.tar.gz |
Apply a patch by Soeren Sandmann to test long statusbar texts.
2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testgtk.c: Apply a patch by Soeren Sandmann to
test long statusbar texts.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testgtk.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index 0ca5a617c8..006a2ba4ee 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -1213,6 +1213,17 @@ statusbar_push (GtkWidget *button, } static void +statusbar_push_long (GtkWidget *button, + GtkStatusbar *statusbar) +{ + gchar text[1024]; + + sprintf (text, "Just because a system has menu choices written with English words, phrases or sentences, that is no guarantee, that it is comprehensible. Individual words may not be familiar to some users (for example, \"repaginate\"), and two menu items may appear to satisfy the users's needs, whereas only one does (for example, \"put away\" or \"eject\")."); + + gtk_statusbar_push (statusbar, 1, text); +} + +static void statusbar_pop (GtkWidget *button, GtkStatusbar *statusbar) { @@ -1335,6 +1346,14 @@ create_statusbar (GtkWidget *widget) NULL), "swapped_signal_after::clicked", statusbar_contexts, statusbar, NULL); + + button = g_object_connect (gtk_widget_new (gtk_button_get_type (), + "label", "push something long", + "visible", TRUE, + "parent", box2, + NULL), + "signal_after::clicked", statusbar_push_long, statusbar, + NULL); separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); @@ -2021,7 +2040,7 @@ create_handle_box (GtkWidget *widget) gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (widget)); - + gtk_window_set_modal (GTK_WINDOW (window), TRUE); gtk_window_set_title (GTK_WINDOW (window), "Handle Box Test"); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); @@ -2557,21 +2576,25 @@ void create_labels (GtkWidget *widget) frame = gtk_frame_new ("Normal Label"); label = gtk_label_new ("This is a Normal label"); + gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_START); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Multi-line Label"); label = gtk_label_new ("This is a Multi-line label.\nSecond line\nThird line"); + gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Left Justified Label"); label = gtk_label_new ("This is a Left-Justified\nMulti-line label.\nThird line"); + gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_MIDDLE); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); frame = gtk_frame_new ("Right Justified Label"); + gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_START); label = gtk_label_new ("This is a Right-Justified\nMulti-line label.\nFourth line, (j/k)"); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT); gtk_container_add (GTK_CONTAINER (frame), label); @@ -10955,6 +10978,7 @@ create_progress_bar (GtkWidget *widget) pdata->pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR, "adjustment", adj, + "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL); gtk_progress_set_format_string (GTK_PROGRESS (pdata->pbar), "%v from [%l,%u] (=%p%%)"); |