From d553992a3c1aa98ae615b9e009ea23fcbcab0242 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 16 Aug 1998 21:02:14 +0000 Subject: [PATCH] 1) corrected bug in log.cpp which only affected wxGTK: some messages could appear twice 2) tried to use gtk_widget_set_usize in wxFrame::SetSizeHints(), but it still doesn't work... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/gdicmn.cpp | 1 - src/common/log.cpp | 4 +++- src/gtk/frame.cpp | 16 +++++++++++++--- src/gtk1/frame.cpp | 16 +++++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 543e78e18d..1045d4c0ab 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -384,7 +384,6 @@ void wxInitializeStockObjects () void wxDeleteStockObjects () { - wxDELETE(wxNORMAL_FONT); wxDELETE(wxSMALL_FONT); wxDELETE(wxITALIC_FONT); diff --git a/src/common/log.cpp b/src/common/log.cpp index 94bf306c74..e1840f24ad 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -421,6 +421,9 @@ void wxLogGui::Flush() if ( !m_bHasMessages ) return; + // do it right now to block any new calls to Flush() while we're here + m_bHasMessages = FALSE; + // @@@ ugly... // concatenate all strings (but not too many to not overfill the msg box) @@ -449,7 +452,6 @@ void wxLogGui::Flush() } // no undisplayed messages whatsoever - m_bHasMessages = m_bErrors = FALSE; m_aMessages.Empty(); } diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 7791d8203e..7424ec63fc 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -269,7 +269,8 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height m_width = width; m_height = height; - gtk_widget_set_usize( m_widget, width, height ); + // VZ: why?? + //gtk_widget_set_usize( m_widget, width, height ); int main_x = 0; int main_y = 0; @@ -514,10 +515,19 @@ void wxFrame::SetTitle( const wxString &title ) gtk_window_set_title( GTK_WINDOW(m_widget), title ); } -void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) ) +void wxFrame::SetSizeHints(int minW, int minH, + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW) ) { + // gdk_window_set_hints alone doesn't really prevent the user from shrinking + // the window to the size smaller than (minW, minH) + gtk_widget_set_usize( GTK_WIDGET(m_widget), minW, minH ); + + /* gdk_window_set_hints( m_widget->window, -1, -1, - minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE ); + minW, minH, maxW, maxH, + GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE ); + */ } void wxFrame::SetIcon( const wxIcon &icon ) diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 7791d8203e..7424ec63fc 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -269,7 +269,8 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height m_width = width; m_height = height; - gtk_widget_set_usize( m_widget, width, height ); + // VZ: why?? + //gtk_widget_set_usize( m_widget, width, height ); int main_x = 0; int main_y = 0; @@ -514,10 +515,19 @@ void wxFrame::SetTitle( const wxString &title ) gtk_window_set_title( GTK_WINDOW(m_widget), title ); } -void wxFrame::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) ) +void wxFrame::SetSizeHints(int minW, int minH, + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW) ) { + // gdk_window_set_hints alone doesn't really prevent the user from shrinking + // the window to the size smaller than (minW, minH) + gtk_widget_set_usize( GTK_WIDGET(m_widget), minW, minH ); + + /* gdk_window_set_hints( m_widget->window, -1, -1, - minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE ); + minW, minH, maxW, maxH, + GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE ); + */ } void wxFrame::SetIcon( const wxIcon &icon ) -- 2.45.2