diff --git a/src/dialogs/dialog.c b/src/dialogs/dialog.c index 118b5cb..0bf47e1 100644 --- a/src/dialogs/dialog.c +++ b/src/dialogs/dialog.c @@ -76,6 +76,8 @@ #ifdef G_OS_UNIX gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),18); +#else + gtk_box_set_spacing(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),3); #endif // UNIX // Setup window @@ -84,6 +86,7 @@ gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(widget))); gtk_window_set_modal(GTK_WINDOW(dialog),TRUE); + g_signal_connect(dialog,"close",G_CALLBACK(gtk_widget_destroy),NULL); // Add buttons @@ -97,15 +100,7 @@ response_id = va_arg (args, gint); while(text != NULL) { -#ifdef G_OS_UNIX - gtk_dialog_add_button(GTK_DIALOG(dialog), text, response_id); -#else - - GtkWidget * button = gtk_dialog_add_button(GTK_DIALOG(dialog), text, response_id); - gtk_widget_set_margin_top(button,3); - -#endif // G_OS_UNIX text = va_arg (args, gchar*); if (text == NULL) @@ -119,5 +114,9 @@ } + GtkWidget * v3270_dialog_set_content_area(GtkWidget *dialog, GtkWidget *content_area) { + gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),content_area,TRUE,TRUE,0); + return content_area; + } diff --git a/src/include/v3270/dialogs.h b/src/include/v3270/dialogs.h index 60940a6..7a37d6c 100644 --- a/src/include/v3270/dialogs.h +++ b/src/include/v3270/dialogs.h @@ -36,6 +36,7 @@ G_BEGIN_DECLS LIB3270_EXPORT GtkWidget * v3270_dialog_new_with_buttons(const gchar *title, GtkWidget *widget, const gchar *first_button_text, ...) G_GNUC_NULL_TERMINATED; + LIB3270_EXPORT GtkWidget * v3270_dialog_set_content_area(GtkWidget *dialog, GtkWidget *content_area); LIB3270_EXPORT void v3270_error_popup(GtkWidget *widget, const gchar *title, const gchar *summary, const gchar *body); -- libgit2 0.21.2