fix tool item enter/leave notify, fixes #13083

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67305 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett 2011-03-24 16:52:55 +00:00
parent af2fdacdb8
commit fbf49ef2b1

View File

@ -479,6 +479,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase); wxToolBarTool* tool = static_cast<wxToolBarTool*>(toolBase);
GSList* radioGroup; GSList* radioGroup;
GtkWidget* bin_child;
switch ( tool->GetStyle() ) switch ( tool->GetStyle() )
{ {
case wxTOOL_STYLE_BUTTON: case wxTOOL_STYLE_BUTTON:
@ -544,11 +545,12 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
m_tooltips, wxGTK_CONV(tool->GetShortHelp()), ""); 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_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_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); G_CALLBACK(enter_notify_event), tool);
if (tool->GetKind() == wxITEM_DROPDOWN) if (tool->GetKind() == wxITEM_DROPDOWN)