39 printf (
"Selected element:%d\n", Z);
48 if (gtk_toggle_button_get_active (btn))
49 g_object_set (G_OBJECT (periodic),
"color-style", GCU_PERIODIC_COLOR_NONE, NULL);
58 if (gtk_toggle_button_get_active (btn))
59 g_object_set (G_OBJECT (periodic),
"color-style", GCU_PERIODIC_COLOR_DEFAULT, NULL);
66 int main (
int argc,
char *argv[])
75 gtk_init (&argc, &argv);
77 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
78 gtk_window_set_title (GTK_WINDOW (window),
"GcuPeriodic test");
79 g_signal_connect (G_OBJECT (window),
"destroy",
80 G_CALLBACK (gtk_main_quit),
84 grid = (GtkGrid *) gtk_grid_new ();
85 label = (GtkLabel*) gtk_label_new (
"Color scheme:");
86 gtk_grid_attach (grid, GTK_WIDGET (label), 0, 0, 1, 1);
87 btn = (GtkRadioButton*) gtk_radio_button_new_with_label (NULL,
"None");
88 g_signal_connect (G_OBJECT (btn),
"toggled", (GCallback)
on_color_scheme_none, (gpointer) periodic);
89 gtk_grid_attach (grid, GTK_WIDGET (btn), 1, 0, 1, 1);
90 btn_group = gtk_radio_button_get_group (btn);
91 btn = (GtkRadioButton*) gtk_radio_button_new_with_label (btn_group,
"Default");
92 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (btn), TRUE);
94 gtk_grid_attach (grid, GTK_WIDGET (btn), 2, 0, 1, 1);
95 gtk_grid_attach (grid, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), 0, 1, 3, 1);
97 g_object_set (G_OBJECT (periodic),
"color-style", GCU_PERIODIC_COLOR_DEFAULT,
"expand", TRUE, NULL);
98 g_signal_connect (G_OBJECT (periodic),
"element_changed", (GCallback)
on_changed, NULL);
99 gtk_grid_attach (grid, GTK_WIDGET (
GCU_PERIODIC (periodic)), 0, 2, 3, 1);
100 gtk_container_add (GTK_CONTAINER (window), GTK_WIDGET (grid));
101 gtk_widget_show_all (window);