Add an expander example.
2006-01-10 Matthias Clasen <mclasen@redhat.com> * tests/testgtk.c: Add an expander example.
This commit is contained in:

committed by
Matthias Clasen

parent
4da4ca3103
commit
a469257a23
@ -1,5 +1,7 @@
|
|||||||
2006-01-10 Matthias Clasen <mclasen@redhat.com>
|
2006-01-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* tests/testgtk.c: Add an expander example.
|
||||||
|
|
||||||
* gtk/gtkcalendar.c (gtk_calendar_focus_out): Queue a draw
|
* gtk/gtkcalendar.c (gtk_calendar_focus_out): Queue a draw
|
||||||
when losing the focus. (#326064, Andrew Conkling)
|
when losing the focus. (#326064, Andrew Conkling)
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
2006-01-10 Matthias Clasen <mclasen@redhat.com>
|
2006-01-10 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* tests/testgtk.c: Add an expander example.
|
||||||
|
|
||||||
* gtk/gtkcalendar.c (gtk_calendar_focus_out): Queue a draw
|
* gtk/gtkcalendar.c (gtk_calendar_focus_out): Queue a draw
|
||||||
when losing the focus. (#326064, Andrew Conkling)
|
when losing the focus. (#326064, Andrew Conkling)
|
||||||
|
|
||||||
|
@ -5129,6 +5129,46 @@ create_entry (GtkWidget *widget)
|
|||||||
gtk_widget_destroy (window);
|
gtk_widget_destroy (window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
create_expander (GtkWidget *widget)
|
||||||
|
{
|
||||||
|
GtkWidget *box1;
|
||||||
|
GtkWidget *expander;
|
||||||
|
GtkWidget *hidden;
|
||||||
|
static GtkWidget *window = NULL;
|
||||||
|
|
||||||
|
if (!window)
|
||||||
|
{
|
||||||
|
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||||
|
gtk_window_set_screen (GTK_WINDOW (window),
|
||||||
|
gtk_widget_get_screen (widget));
|
||||||
|
|
||||||
|
g_signal_connect (window, "destroy",
|
||||||
|
G_CALLBACK (gtk_widget_destroyed),
|
||||||
|
&window);
|
||||||
|
|
||||||
|
gtk_window_set_title (GTK_WINDOW (window), "expander");
|
||||||
|
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
|
||||||
|
|
||||||
|
box1 = gtk_vbox_new (FALSE, 0);
|
||||||
|
gtk_container_add (GTK_CONTAINER (window), box1);
|
||||||
|
|
||||||
|
expander = gtk_expander_new ("The Hidden");
|
||||||
|
|
||||||
|
gtk_box_pack_start (GTK_BOX (box1), expander, TRUE, TRUE, 0);
|
||||||
|
|
||||||
|
hidden = gtk_label_new ("Revealed!");
|
||||||
|
|
||||||
|
gtk_container_add (GTK_CONTAINER (expander), hidden);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!GTK_WIDGET_VISIBLE (window))
|
||||||
|
gtk_widget_show_all (window);
|
||||||
|
else
|
||||||
|
gtk_widget_destroy (window);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* GtkEventBox */
|
/* GtkEventBox */
|
||||||
|
|
||||||
|
|
||||||
@ -13192,6 +13232,7 @@ struct {
|
|||||||
{ "entry", create_entry },
|
{ "entry", create_entry },
|
||||||
{ "event box", create_event_box },
|
{ "event box", create_event_box },
|
||||||
{ "event watcher", create_event_watcher },
|
{ "event watcher", create_event_watcher },
|
||||||
|
{ "expander", create_expander },
|
||||||
{ "file selection", create_file_selection },
|
{ "file selection", create_file_selection },
|
||||||
{ "flipping", create_flipping },
|
{ "flipping", create_flipping },
|
||||||
{ "focus", create_focus },
|
{ "focus", create_focus },
|
||||||
|
Reference in New Issue
Block a user