X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e10110af0bf913550b6d336773fa5825e48fb12..65ead2309a826dfda76b1c4e96a8924234bf69a1:/src/gtk/collpane.cpp diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index d312306ca3..324dc3856d 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -29,7 +29,7 @@ // the lines below duplicate the same definitions in collpaneg.cpp, if we have // another implementation of this class we should extract them to a common file -const wxChar wxCollapsiblePaneNameStr[] = wxT("collapsiblePane"); +const char wxCollapsiblePaneNameStr[] = "collapsiblePane"; DEFINE_EVENT_TYPE(wxEVT_COMMAND_COLLPANE_CHANGED) @@ -148,15 +148,14 @@ gtk_collapsiblepane_expanded_callback(GObject * WXUNUSED(object), } } -static void -gtk_collapsiblepane_insert_callback(wxWindowGTK* parent, wxWindowGTK* child) +void wxCollapsiblePane::AddChildGTK(wxWindowGTK* child) { - // this callback should be used only once to insert the "pane" into the + // should be used only once to insert the "pane" into the // GtkExpander widget. wxGenericCollapsiblePane::DoAddChild() will check if // it has been called only once (and in any case we would get a warning // from the following call as GtkExpander is a GtkBin and can contain only // a single child!). - gtk_container_add (GTK_CONTAINER (parent->m_widget), child->m_widget); + gtk_container_add(GTK_CONTAINER(m_widget), child->m_widget); } //----------------------------------------------------------------------------- @@ -189,6 +188,7 @@ bool wxCollapsiblePane::Create(wxWindow *parent, m_widget = gtk_expander_new_with_mnemonic(wxGTK_CONV(GTKConvertMnemonics(label))); + g_object_ref(m_widget); // see the gtk_collapsiblepane_expanded_callback comments to understand why // we connect to the "notify::expanded" signal instead of the more common @@ -196,10 +196,6 @@ bool wxCollapsiblePane::Create(wxWindow *parent, g_signal_connect(m_widget, "notify::expanded", G_CALLBACK(gtk_collapsiblepane_expanded_callback), this); - // before creating m_pPane, we need to makesure our own insert callback - // will be used - m_insertCallback = gtk_collapsiblepane_insert_callback; - // this the real "pane" m_pPane = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL|wxNO_BORDER);