diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/combobox/native_combobox_gtk.cc | 10 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_gtk.cc | 9 |
2 files changed, 14 insertions, 5 deletions
diff --git a/views/controls/combobox/native_combobox_gtk.cc b/views/controls/combobox/native_combobox_gtk.cc index 3075cce..89d2b38 100644 --- a/views/controls/combobox/native_combobox_gtk.cc +++ b/views/controls/combobox/native_combobox_gtk.cc @@ -114,15 +114,15 @@ void NativeComboboxGtk::CreateNativeControl() { G_CALLBACK(CallChanged), this); NativeControlCreated(widget); - - // Set the data from combobox - UpdateFromModel(); - // and show the 1st item by default. - gtk_combo_box_set_active(GTK_COMBO_BOX(widget), 0); } void NativeComboboxGtk::NativeControlCreated(GtkWidget* native_control) { NativeControlGtk::NativeControlCreated(native_control); + + // Set the data from combobox + UpdateFromModel(); + // and show the 1st item by default. + gtk_combo_box_set_active(GTK_COMBO_BOX(native_control), 0); } //////////////////////////////////////////////////////////////////////////////// diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc index 855ce805..3a454fe 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc @@ -60,8 +60,17 @@ View* NativeTabbedPaneGtk::RemoveTabAtIndex(int index) { // last tab. nothing to select. } } + + GtkWidget* page = + gtk_notebook_get_nth_page(GTK_NOTEBOOK(native_view()), index); + WidgetGtk* widget = WidgetGtk::GetViewForNative(page); + + // detach the content view from widget so that we can delete widget + // without destroying the content view. View* removed_tab = GetTabViewAt(index); + widget->GetRootView()->RemoveChildView(removed_tab); + // widget delete itself when native_view is deleted. gtk_notebook_remove_page(GTK_NOTEBOOK(native_view()), index); return removed_tab; |