2013-04-22 13:31:32 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2020-07-24 13:54:49 +00:00
|
|
|
int
|
|
|
|
main (int argc,
|
2020-07-24 18:40:36 +00:00
|
|
|
char ** argv)
|
2013-04-22 13:31:32 +00:00
|
|
|
{
|
|
|
|
GtkWidget *window, *revealer, *box, *widget, *entry;
|
|
|
|
|
2016-12-28 13:53:22 +00:00
|
|
|
gtk_init ();
|
2013-04-22 13:31:32 +00:00
|
|
|
|
2020-02-14 19:55:36 +00:00
|
|
|
window = gtk_window_new ();
|
2013-04-22 13:31:32 +00:00
|
|
|
gtk_widget_set_size_request (window, 300, 300);
|
|
|
|
|
|
|
|
box = gtk_grid_new ();
|
2020-05-02 21:26:54 +00:00
|
|
|
gtk_window_set_child (GTK_WINDOW (window), box);
|
2013-04-22 13:31:32 +00:00
|
|
|
|
|
|
|
widget = gtk_label_new ("Some filler text to avoid\nresizing of the window");
|
|
|
|
gtk_widget_set_margin_top (widget, 10);
|
|
|
|
gtk_widget_set_margin_bottom (widget, 10);
|
2013-11-14 22:31:17 +00:00
|
|
|
gtk_widget_set_margin_start (widget, 10);
|
|
|
|
gtk_widget_set_margin_end (widget, 10);
|
2013-04-22 13:31:32 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 1, 1, 1, 1);
|
|
|
|
|
|
|
|
widget = gtk_label_new ("Some filler text to avoid\nresizing of the window");
|
|
|
|
gtk_widget_set_margin_top (widget, 10);
|
|
|
|
gtk_widget_set_margin_bottom (widget, 10);
|
2013-11-14 22:31:17 +00:00
|
|
|
gtk_widget_set_margin_start (widget, 10);
|
|
|
|
gtk_widget_set_margin_end (widget, 10);
|
2019-03-29 14:51:00 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 4, 4, 1, 1);
|
2013-04-22 13:31:32 +00:00
|
|
|
|
|
|
|
widget = gtk_toggle_button_new_with_label ("None");
|
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 0, 0, 1, 1);
|
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_halign (revealer, GTK_ALIGN_START);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
|
|
|
|
entry = gtk_entry_new ();
|
2019-02-28 19:31:36 +00:00
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "00000");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2013-04-22 13:31:32 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_NONE);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 1, 0, 1, 1);
|
|
|
|
|
2013-04-22 13:42:48 +00:00
|
|
|
widget = gtk_toggle_button_new_with_label ("Fade");
|
2019-03-29 14:51:00 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 5, 5, 1, 1);
|
2013-04-22 13:31:32 +00:00
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_halign (revealer, GTK_ALIGN_END);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_END);
|
|
|
|
entry = gtk_entry_new ();
|
2019-02-28 19:31:36 +00:00
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "00000");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2013-04-22 13:31:32 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
2013-04-22 13:42:48 +00:00
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
|
2013-04-22 13:31:32 +00:00
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
2019-03-29 14:51:00 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 4, 5, 1, 1);
|
2013-04-22 13:31:32 +00:00
|
|
|
|
2019-03-29 14:51:00 +00:00
|
|
|
widget = gtk_toggle_button_new_with_label ("Slide");
|
2013-04-22 13:31:32 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 0, 2, 1, 1);
|
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_hexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_halign (revealer, GTK_ALIGN_START);
|
|
|
|
entry = gtk_entry_new ();
|
2019-02-28 19:31:36 +00:00
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "12345");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2013-04-22 13:31:32 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 1, 2, 1, 1);
|
|
|
|
|
2019-03-29 14:51:00 +00:00
|
|
|
widget = gtk_toggle_button_new_with_label ("Swing");
|
|
|
|
gtk_widget_set_valign (widget, GTK_ALIGN_START);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 0, 3, 1, 1);
|
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_hexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_halign (revealer, GTK_ALIGN_START);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "12345");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2019-03-29 14:51:00 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_RIGHT);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 1, 3, 1, 1);
|
|
|
|
|
|
|
|
widget = gtk_toggle_button_new_with_label ("Slide");
|
2013-04-22 13:31:32 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 2, 0, 1, 1);
|
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_vexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
|
|
|
|
entry = gtk_entry_new ();
|
2019-03-02 04:28:55 +00:00
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "23456");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2013-04-22 13:31:32 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 2, 1, 1, 1);
|
|
|
|
|
2019-03-29 14:51:00 +00:00
|
|
|
widget = gtk_toggle_button_new_with_label ("Swing");
|
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 3, 0, 1, 1);
|
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_vexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "23456");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2019-03-29 14:51:00 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_DOWN);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 3, 1, 1, 1);
|
|
|
|
|
|
|
|
widget = gtk_toggle_button_new_with_label ("Slide");
|
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 5, 2, 1, 1);
|
2013-04-22 13:31:32 +00:00
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_hexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_halign (revealer, GTK_ALIGN_END);
|
|
|
|
entry = gtk_entry_new ();
|
2019-02-28 19:31:36 +00:00
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "34567");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2013-04-22 13:31:32 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
2019-03-29 14:51:00 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 4, 2, 1, 1);
|
|
|
|
|
|
|
|
widget = gtk_toggle_button_new_with_label ("Swing");
|
|
|
|
gtk_widget_set_valign (widget, GTK_ALIGN_START);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 5, 3, 1, 1);
|
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_hexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_halign (revealer, GTK_ALIGN_END);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_START);
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "34567");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2019-03-29 14:51:00 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_LEFT);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 4, 3, 1, 1);
|
2013-04-22 13:31:32 +00:00
|
|
|
|
2019-03-29 14:51:00 +00:00
|
|
|
widget = gtk_toggle_button_new_with_label ("Slide");
|
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 2, 5, 1, 1);
|
2013-04-22 13:31:32 +00:00
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_vexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_END);
|
|
|
|
entry = gtk_entry_new ();
|
2019-02-28 19:31:36 +00:00
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "45678");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2013-04-22 13:31:32 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
2019-03-29 14:51:00 +00:00
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 2, 4, 1, 1);
|
|
|
|
|
|
|
|
widget = gtk_toggle_button_new_with_label ("Swing");
|
|
|
|
gtk_grid_attach (GTK_GRID (box), widget, 3, 5, 1, 1);
|
|
|
|
revealer = gtk_revealer_new ();
|
|
|
|
gtk_widget_set_vexpand (revealer, TRUE);
|
|
|
|
gtk_widget_set_valign (revealer, GTK_ALIGN_END);
|
|
|
|
entry = gtk_entry_new ();
|
|
|
|
gtk_editable_set_text (GTK_EDITABLE (entry), "45678");
|
2020-05-02 21:02:42 +00:00
|
|
|
gtk_revealer_set_child (GTK_REVEALER (revealer), entry);
|
2019-03-29 14:51:00 +00:00
|
|
|
g_object_bind_property (widget, "active", revealer, "reveal-child", 0);
|
|
|
|
gtk_revealer_set_transition_type (GTK_REVEALER (revealer), GTK_REVEALER_TRANSITION_TYPE_SWING_UP);
|
|
|
|
gtk_revealer_set_transition_duration (GTK_REVEALER (revealer), 2000);
|
|
|
|
gtk_grid_attach (GTK_GRID (box), revealer, 3, 4, 1, 1);
|
2013-04-22 13:31:32 +00:00
|
|
|
|
2022-11-29 12:06:33 +00:00
|
|
|
gtk_window_present (GTK_WINDOW (window));
|
2020-02-10 03:24:47 +00:00
|
|
|
while (TRUE)
|
|
|
|
g_main_context_iteration (NULL, TRUE);
|
2013-04-22 13:31:32 +00:00
|
|
|
|
2020-05-09 14:26:22 +00:00
|
|
|
gtk_window_destroy (GTK_WINDOW (window));
|
2013-04-22 13:31:32 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|