]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/minifram.cpp
Resets scroll position on load
[wxWidgets.git] / src / gtk / minifram.cpp
index c23782237b723898a8acfda7244baa3b9d2b8c0b..0e4b631ce135e429b0614f00e5b0cb3fce0dc50b 100644 (file)
@@ -7,9 +7,8 @@
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-#pragma implementation "minifram.h"
-#endif
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
 
 #include "wx/minifram.h"
 
@@ -66,6 +65,7 @@ static void DrawFrame( GtkWidget *widget, int x, int y, int w, int h )
 // "expose_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *gdk_event, wxFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -106,12 +106,14 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g
         dc.DrawText( win->GetTitle(), 6, 3 );
     }
 }
+}
 
 //-----------------------------------------------------------------------------
 // "draw" of m_mainWidget
 //-----------------------------------------------------------------------------
 
 #ifndef __WXGTK20__
+extern "C" {
 static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNUSED(rect), wxFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -151,12 +153,14 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
         dc.DrawText( win->GetTitle(), 6, 3 );
     }
 }
+}
 #endif
 
 //-----------------------------------------------------------------------------
 // "button_press_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -200,11 +204,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton
 
     return TRUE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // "button_release_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButton *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -233,11 +239,13 @@ static gint gtk_window_button_release_callback( GtkWidget *widget, GdkEventButto
 
     return TRUE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // "motion_notify_event" of m_mainWidget
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion *gdk_event, wxMiniFrame *win )
 {
     if (g_isIdle) wxapp_install_idle_handler();
@@ -266,17 +274,20 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget, GdkEventMotion
 
     return TRUE;
 }
+}
 
 //-----------------------------------------------------------------------------
 // "clicked" of X system button
 //-----------------------------------------------------------------------------
 
+extern "C" {
 static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxMiniFrame *mf )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 
     mf->Close();
 }
+}
 
 //-----------------------------------------------------------------------------
 // wxMiniFrame
@@ -386,4 +397,15 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title
     return TRUE;
 }
 
+void wxMiniFrame::SetTitle( const wxString &title )
+{
+    wxFrame::SetTitle( title );
+    
+#ifdef __WXGTK20__
+    gdk_window_invalidate_rect( GTK_PIZZA(m_mainWidget)->bin_window, NULL, true );
+#else
+    gtk_widget_draw( m_mainWidget, (GdkRectangle*) NULL );
+#endif
+}
+
 #endif