diff --git a/tests/dialog.ui b/tests/dialog.ui new file mode 100644 index 0000000000..dbb3dbcf06 --- /dev/null +++ b/tests/dialog.ui @@ -0,0 +1,261 @@ + + + + + + + + + + + liststore1 + 0 + True + + + False + True + True + dialog + 500 + 1 + + + True + Join Chat Room + + + False + True + center + + + + True + 1 + + + + + + + _Cancel + True + True + True + True + + + + + _Join + True + True + True + True + True + True + + + end + + + + + + + False + vertical + 2 + + + True + slide-left-right + + + True + False + 24 + 24 + 24 + 24 + 12 + 12 + + + True + 24 + + + 0 + 0 + 1 + 1 + + + + + True + True + True + False + True + optional + password + + + 2 + 2 + 2 + 1 + + + + + True + True + True + 24 + True + name_completion + + + 2 + 1 + 2 + 1 + + + + + True + True + True + + + True + False + 6 + + + True + False + list-add-symbolic + + + False + True + 0 + + + + + True + False + _Add Connection + True + add_connection_button + + + False + True + 1 + + + + + + + 3 + 0 + 1 + 1 + + + + + True + False + True + + + 2 + 0 + 1 + 1 + + + + + True + False + end + C_onnection + True + connection_combo + + + 1 + 0 + 1 + 1 + + + + + True + False + end + 24 + Room _Name + True + name_entry + + + 1 + 1 + 1 + 1 + + + + + True + False + end + _Password + True + password_entry + + + 1 + 2 + 1 + 1 + + + + + main + 0 + + + + + False + True + 1 + + + + + + cancel_button + + + confirm_button + + + diff --git a/tests/testdialog.c b/tests/testdialog.c index dbc2ff2de1..3c955074d5 100644 --- a/tests/testdialog.c +++ b/tests/testdialog.c @@ -177,6 +177,21 @@ show_dialog_with_header_buttons (GtkWindow *parent) gtk_widget_destroy (dialog); } +static void +show_dialog_with_header_buttons2 (GtkWindow *parent) +{ + GtkBuilder *builder; + GtkWidget *dialog; + + builder = gtk_builder_new (); + gtk_builder_add_from_file (builder, "dialog.ui", NULL); + dialog = (GtkWidget *)gtk_builder_get_object (builder, "dialog"); + g_object_unref (builder); + + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); +} + typedef struct { GtkDialog parent; } MyDialog; @@ -364,6 +379,12 @@ main (int argc, char *argv[]) gtk_widget_show (button); gtk_container_add (GTK_CONTAINER (box), button); + button = gtk_button_new_with_label ("Header & Buttons & Builder"); + g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_with_header_buttons2), window); + gtk_widget_show (button); + gtk_container_add (GTK_CONTAINER (box), button); + + button = gtk_button_new_with_label ("Template"); button = gtk_button_new_with_label ("Template"); g_signal_connect_swapped (button, "clicked", G_CALLBACK (show_dialog_from_template), window); gtk_widget_show (button);