]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxWindowGTK::GTKConnectWidget() helper.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 5 Oct 2009 22:55:01 +0000 (22:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 5 Oct 2009 22:55:01 +0000 (22:55 +0000)
This trivial wrapper function allows to omit "m_widget" and "this" arguments
when calling g_signal_connect().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/window.h
src/gtk/window.cpp

index f3639f2c8c3cdf70270253236e5ad657d6d55298..fb342e9a0b651b7a625c1b44d819904c61960723 100644 (file)
@@ -363,6 +363,12 @@ protected:
     // should be called from OnInternalIdle() if it's overridden
     void GTKUpdateCursor();
 
+    // Connect the given function to the specified signal on m_widget.
+    //
+    // This is just a wrapper for g_signal_connect() and returns the handler id
+    // just as it does.
+    gulong GTKConnectWidget(const char *signal, void (*callback)());
+
     // Return true from here if PostCreation() should connect to size_request
     // signal: this is done by default but doesn't work for some native
     // controls which override this function to return false
index e73b3ebb826074d2434e6eed4f68b06987f9ffdb..3a4ec1ae2a79d59ce6270365c1c562bf3472b8eb 100644 (file)
@@ -2382,6 +2382,11 @@ void wxWindowGTK::PostCreation()
         gtk_widget_show( m_widget );
 }
 
+gulong wxWindowGTK::GTKConnectWidget(const char *signal, void (*callback)())
+{
+    return g_signal_connect(m_widget, signal, callback, this);
+}
+
 void wxWindowGTK::ConnectWidget( GtkWidget *widget )
 {
     g_signal_connect (widget, "key_press_event",