From: Paul Cornett Date: Thu, 7 Aug 2008 15:59:33 +0000 (+0000) Subject: allow dialog to be resized smaller with extra control X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/38a36cf51782be0a645d3f5a83289d5e702fe3ab allow dialog to be resized smaller with extra control git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index 62fc00864a..09f353fb7f 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -131,6 +131,18 @@ static void gtk_filedialog_update_preview_callback(GtkFileChooser *chooser, } // extern "C" +//----------------------------------------------------------------------------- +// "size_request" from m_extraControl +//----------------------------------------------------------------------------- + +extern "C" { +static void extra_widget_size_request(GtkWidget*, GtkRequisition* req, void*) +{ + // allow dialog to be resized smaller horizontally + req->width = 1; +} +} + static void wxInsertChildInFileDialog(wxWindow* WXUNUSED(parent), wxWindow* WXUNUSED(child)) { @@ -298,6 +310,8 @@ int wxFileDialog::ShowModal() wxASSERT(control->parent == NULL); gtk_widget_show(control); + g_signal_connect_after(control, "size_request", + G_CALLBACK(extra_widget_size_request), NULL); gtk_file_chooser_set_extra_widget(GTK_FILE_CHOOSER(m_widget), control); }