]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/toolbar.cpp
fix tool item enter/leave notify, fixes #13083
[wxWidgets.git] / src / gtk / toolbar.cpp
index 969c7f9f360f55b806ea72b459a3e10d662d4bff..f883bc0801bb749337e8dfd72b98986f3a542807 100644 (file)
@@ -479,6 +479,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
     wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
 
     GSList* radioGroup;
+    GtkWidget* bin_child;
     switch ( tool->GetStyle() )
     {
         case wxTOOL_STYLE_BUTTON:
@@ -544,11 +545,12 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
                         m_tooltips, wxGTK_CONV(tool->GetShortHelp()), "");
                 }
             }
-            g_signal_connect(GTK_BIN(tool->m_item)->child, "button_press_event",
+            bin_child = gtk_bin_get_child(GTK_BIN(tool->m_item));
+            g_signal_connect(bin_child, "button_press_event",
                 G_CALLBACK(button_press_event), tool);
-            g_signal_connect(tool->m_item, "enter_notify_event",
+            g_signal_connect(bin_child, "enter_notify_event",
                 G_CALLBACK(enter_notify_event), tool);
-            g_signal_connect(tool->m_item, "leave_notify_event",
+            g_signal_connect(bin_child, "leave_notify_event",
                 G_CALLBACK(enter_notify_event), tool);
 
             if (tool->GetKind() == wxITEM_DROPDOWN)