avoid gtk_widget_reparent(), deprecated in GTK+ 3.14
(cherry picked from commit f8e430e479
)
This commit is contained in:
@@ -328,6 +328,8 @@ void wxFrame::SetToolBar(wxToolBar *toolbar)
|
|||||||
m_frameToolBar = toolbar;
|
m_frameToolBar = toolbar;
|
||||||
if (toolbar)
|
if (toolbar)
|
||||||
{
|
{
|
||||||
|
gtk_container_remove(
|
||||||
|
GTK_CONTAINER(gtk_widget_get_parent(toolbar->m_widget)), toolbar->m_widget);
|
||||||
if (toolbar->IsVertical())
|
if (toolbar->IsVertical())
|
||||||
{
|
{
|
||||||
// Vertical toolbar and m_wxwindow go into an hbox, inside the
|
// Vertical toolbar and m_wxwindow go into an hbox, inside the
|
||||||
@@ -343,9 +345,7 @@ void wxFrame::SetToolBar(wxToolBar *toolbar)
|
|||||||
gtk_box_pack_start(GTK_BOX(hbox), m_wxwindow, true, true, 0);
|
gtk_box_pack_start(GTK_BOX(hbox), m_wxwindow, true, true, 0);
|
||||||
g_object_unref(m_wxwindow);
|
g_object_unref(m_wxwindow);
|
||||||
}
|
}
|
||||||
gtk_widget_reparent(toolbar->m_widget, hbox);
|
gtk_box_pack_start(GTK_BOX(hbox), toolbar->m_widget, false, false, 0);
|
||||||
gtk_box_set_child_packing(GTK_BOX(hbox),
|
|
||||||
toolbar->m_widget, false, false, 0, GTK_PACK_START);
|
|
||||||
|
|
||||||
int pos = 0; // left
|
int pos = 0; // left
|
||||||
if (toolbar->HasFlag(wxTB_RIGHT))
|
if (toolbar->HasFlag(wxTB_RIGHT))
|
||||||
@@ -355,9 +355,7 @@ void wxFrame::SetToolBar(wxToolBar *toolbar)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Horizontal toolbar goes into vbox (m_mainWidget)
|
// Horizontal toolbar goes into vbox (m_mainWidget)
|
||||||
gtk_widget_reparent(toolbar->m_widget, m_mainWidget);
|
gtk_box_pack_start(GTK_BOX(m_mainWidget), toolbar->m_widget, false, false, 0);
|
||||||
gtk_box_set_child_packing(GTK_BOX(m_mainWidget),
|
|
||||||
toolbar->m_widget, false, false, 0, GTK_PACK_START);
|
|
||||||
|
|
||||||
int pos = 0; // top
|
int pos = 0; // top
|
||||||
if (m_frameMenuBar)
|
if (m_frameMenuBar)
|
||||||
@@ -385,9 +383,9 @@ void wxFrame::SetStatusBar(wxStatusBar *statbar)
|
|||||||
if (statbar)
|
if (statbar)
|
||||||
{
|
{
|
||||||
// statusbar goes into bottom of vbox (m_mainWidget)
|
// statusbar goes into bottom of vbox (m_mainWidget)
|
||||||
gtk_widget_reparent(statbar->m_widget, m_mainWidget);
|
gtk_container_remove(
|
||||||
gtk_box_set_child_packing(GTK_BOX(m_mainWidget),
|
GTK_CONTAINER(gtk_widget_get_parent(statbar->m_widget)), statbar->m_widget);
|
||||||
statbar->m_widget, false, false, 0, GTK_PACK_END);
|
gtk_box_pack_end(GTK_BOX(m_mainWidget), statbar->m_widget, false, false, 0);
|
||||||
// make sure next size_allocate on statusbar causes a size event
|
// make sure next size_allocate on statusbar causes a size event
|
||||||
statbar->m_useCachedClientSize = false;
|
statbar->m_useCachedClientSize = false;
|
||||||
statbar->m_clientWidth = 0;
|
statbar->m_clientWidth = 0;
|
||||||
|
@@ -281,7 +281,10 @@ void wxToolBarTool::CreateDropDown()
|
|||||||
GtkWidget* box = gtk_box_new(orient, 0);
|
GtkWidget* box = gtk_box_new(orient, 0);
|
||||||
GtkWidget* arrow = gtk_arrow_new(arrowType, GTK_SHADOW_NONE);
|
GtkWidget* arrow = gtk_arrow_new(arrowType, GTK_SHADOW_NONE);
|
||||||
GtkWidget* tool_button = gtk_bin_get_child(GTK_BIN(m_item));
|
GtkWidget* tool_button = gtk_bin_get_child(GTK_BIN(m_item));
|
||||||
gtk_widget_reparent(tool_button, box);
|
g_object_ref(tool_button);
|
||||||
|
gtk_container_remove(GTK_CONTAINER(m_item), tool_button);
|
||||||
|
gtk_container_add(GTK_CONTAINER(box), tool_button);
|
||||||
|
g_object_unref(tool_button);
|
||||||
GtkWidget* arrow_button = gtk_toggle_button_new();
|
GtkWidget* arrow_button = gtk_toggle_button_new();
|
||||||
gtk_button_set_relief(GTK_BUTTON(arrow_button),
|
gtk_button_set_relief(GTK_BUTTON(arrow_button),
|
||||||
gtk_tool_item_get_relief_style(GTK_TOOL_ITEM(m_item)));
|
gtk_tool_item_get_relief_style(GTK_TOOL_ITEM(m_item)));
|
||||||
|
Reference in New Issue
Block a user