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.
This commit is contained in:
Matthias Clasen 2004-11-09 06:14:11 +00:00 committed by Matthias Clasen
parent 876fba5940
commit dd3948538b
5 changed files with 37 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testgtk.c: Apply a patch by Soeren Sandmann to
test long statusbar texts.
* gtk/gtk.symbols: Add new symbols. * gtk/gtk.symbols: Add new symbols.
Avoid resizing GtkStatusbar if the text of the label Avoid resizing GtkStatusbar if the text of the label

View File

@ -1,5 +1,8 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testgtk.c: Apply a patch by Soeren Sandmann to
test long statusbar texts.
* gtk/gtk.symbols: Add new symbols. * gtk/gtk.symbols: Add new symbols.
Avoid resizing GtkStatusbar if the text of the label Avoid resizing GtkStatusbar if the text of the label

View File

@ -1,5 +1,8 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testgtk.c: Apply a patch by Soeren Sandmann to
test long statusbar texts.
* gtk/gtk.symbols: Add new symbols. * gtk/gtk.symbols: Add new symbols.
Avoid resizing GtkStatusbar if the text of the label Avoid resizing GtkStatusbar if the text of the label

View File

@ -1,5 +1,8 @@
2004-11-09 Matthias Clasen <mclasen@redhat.com> 2004-11-09 Matthias Clasen <mclasen@redhat.com>
* tests/testgtk.c: Apply a patch by Soeren Sandmann to
test long statusbar texts.
* gtk/gtk.symbols: Add new symbols. * gtk/gtk.symbols: Add new symbols.
Avoid resizing GtkStatusbar if the text of the label Avoid resizing GtkStatusbar if the text of the label

View File

@ -1212,6 +1212,17 @@ statusbar_push (GtkWidget *button,
gtk_statusbar_push (statusbar, 1, text); gtk_statusbar_push (statusbar, 1, text);
} }
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 static void
statusbar_pop (GtkWidget *button, statusbar_pop (GtkWidget *button,
GtkStatusbar *statusbar) GtkStatusbar *statusbar)
@ -1336,6 +1347,14 @@ create_statusbar (GtkWidget *widget)
"swapped_signal_after::clicked", statusbar_contexts, statusbar, "swapped_signal_after::clicked", statusbar_contexts, statusbar,
NULL); 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 (); separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); 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_window_set_screen (GTK_WINDOW (window),
gtk_widget_get_screen (widget)); gtk_widget_get_screen (widget));
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
gtk_window_set_title (GTK_WINDOW (window), gtk_window_set_title (GTK_WINDOW (window),
"Handle Box Test"); "Handle Box Test");
gtk_window_set_resizable (GTK_WINDOW (window), FALSE); gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
@ -2557,21 +2576,25 @@ void create_labels (GtkWidget *widget)
frame = gtk_frame_new ("Normal Label"); frame = gtk_frame_new ("Normal Label");
label = gtk_label_new ("This is a 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_container_add (GTK_CONTAINER (frame), label);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Multi-line Label"); frame = gtk_frame_new ("Multi-line Label");
label = gtk_label_new ("This is a Multi-line label.\nSecond line\nThird line"); 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_container_add (GTK_CONTAINER (frame), label);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Left Justified Label"); frame = gtk_frame_new ("Left Justified Label");
label = gtk_label_new ("This is a Left-Justified\nMulti-line label.\nThird line"); 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_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_container_add (GTK_CONTAINER (frame), label); gtk_container_add (GTK_CONTAINER (frame), label);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Right Justified Label"); 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)"); 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_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
gtk_container_add (GTK_CONTAINER (frame), label); 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, pdata->pbar = gtk_widget_new (GTK_TYPE_PROGRESS_BAR,
"adjustment", adj, "adjustment", adj,
"ellipsize", PANGO_ELLIPSIZE_MIDDLE,
NULL); NULL);
gtk_progress_set_format_string (GTK_PROGRESS (pdata->pbar), gtk_progress_set_format_string (GTK_PROGRESS (pdata->pbar),
"%v from [%l,%u] (=%p%%)"); "%v from [%l,%u] (=%p%%)");