From 7965e0e50dc1785d0053473646e666afcb9cb9cc Mon Sep 17 00:00:00 2001 From: "Predrag \"Pele\" Balorda" Date: Thu, 26 Nov 1998 12:21:23 +0000 Subject: [PATCH] A few quick fixes to get it up to speed with latest Gtk-- version and finally make it work. --- contrib/gtk-tool/Gtk_LdapTreeItem.cc | 4 ++-- contrib/gtk-tool/My_Scroller.cc | 8 +++++--- contrib/gtk-tool/My_Window.cc | 16 ++++++++-------- contrib/gtk-tool/main.cc | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/contrib/gtk-tool/Gtk_LdapTreeItem.cc b/contrib/gtk-tool/Gtk_LdapTreeItem.cc index a7d0e1b43b..baaba04174 100644 --- a/contrib/gtk-tool/Gtk_LdapTreeItem.cc +++ b/contrib/gtk-tool/Gtk_LdapTreeItem.cc @@ -23,7 +23,7 @@ int Gtk_LdapTreeItem::search() { } par->scroller2->add_child(this->notebook); // par->scroller2->remove((Gtk_Object)par->scroller2->children()->first()); - this->notebook->reparent(par->scroller2); + this->notebook->reparent(*par->scroller2); this->notebook->show(); par->scroller2->show(); return 0; @@ -45,7 +45,7 @@ int Gtk_LdapTreeItem::search() { } ldap_value_free(values); label = new Gtk_Label(attribute); - notebook->append_page(table, label); + notebook->append_page(*table, *label); table->show(); label->show(); } diff --git a/contrib/gtk-tool/My_Scroller.cc b/contrib/gtk-tool/My_Scroller.cc index 0f73c8abf2..19c4da22e8 100644 --- a/contrib/gtk-tool/My_Scroller.cc +++ b/contrib/gtk-tool/My_Scroller.cc @@ -3,11 +3,13 @@ #include void My_Scroller::remove_child(int i) { - cout << "Unparenting child[" << i << "]" << endl; - this->children[i]->unparent(); +// cout << "Unparenting child[" << i << "]" << endl; +// this->children[i]->unparent(); cout << "Deleting child[" << i << "] from children" << endl; // this->remove(children()->first()); - delete this->children[i]; +// delete this->children[i]; + this->remove_c(this->children[i]->gtkobj()); + gtk_widget_destroy(this->children[i]->gtkobj()); cout << "done" << endl; } void My_Scroller::add_child(Gtk_Widget *w) { diff --git a/contrib/gtk-tool/My_Window.cc b/contrib/gtk-tool/My_Window.cc index 38d433b0c5..0b1eabafea 100644 --- a/contrib/gtk-tool/My_Window.cc +++ b/contrib/gtk-tool/My_Window.cc @@ -9,26 +9,26 @@ My_Window::My_Window(GtkWindowType t) : Gtk_Window(t) { this->scroller = new Gtk_ScrolledWindow(); this->scroller->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); // this->scroller->set_usize(this->height(), 400); - pane->add1(this->scroller); + pane->add1(*this->scroller); this->scroller->show(); this->scroller2 = new My_Scroller(); this->scroller2->set_policy(GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - pane->add2(this->scroller2); + pane->add2(*this->scroller2); this->scroller2->show(); top_hbox = new Gtk_HBox(); this->urlfield = new Gtk_Entry(); - top_hbox->pack_start(this->urlfield, TRUE, TRUE, 1); + top_hbox->pack_start(*this->urlfield, TRUE, TRUE, 1); this->urlfield->show(); this->display_button = new Gtk_Button("Display"); connect_to_method(this->display_button->clicked, this, &do_display); - top_hbox->pack_end(this->display_button, FALSE, FALSE, 1); + top_hbox->pack_end(*this->display_button, FALSE, FALSE, 1); this->display_button->show(); main_hbox = new Gtk_VBox(); - main_hbox->pack_start(top_hbox, FALSE, TRUE, 1); - main_hbox->pack_end(pane, TRUE, TRUE, 1); + main_hbox->pack_start(*top_hbox, FALSE, TRUE, 1); + main_hbox->pack_end(*pane, TRUE, TRUE, 1); top_hbox->show(); pane->show(); this->add(main_hbox); @@ -86,13 +86,13 @@ Gtk_LdapItem* My_Window::make_tree(My_Window *p, LDAP* l_i, char* b_d) { s = ldap_explode_dn(ldap_get_dn(l_i, entry), 1); subtreeresult = make_tree(p, l_i, ldap_get_dn(l_i, entry)); subtreeitem = new Gtk_LdapTreeItem(*subtreeresult->treeitem); - subtree->append(subtreeitem); + subtree->append(*subtreeitem); printf("inserting %s into %s", s[0], c); if (subtreeresult->tree != NULL) { printf("."); subsubtree = new Gtk_Tree(*subtreeresult->tree); printf("."); - subtreeitem->set_subtree(subsubtree); + subtreeitem->set_subtree(*subsubtree); printf("."); } subtreeitem->show(); diff --git a/contrib/gtk-tool/main.cc b/contrib/gtk-tool/main.cc index c5dfb272d3..40a9ef5029 100644 --- a/contrib/gtk-tool/main.cc +++ b/contrib/gtk-tool/main.cc @@ -31,7 +31,7 @@ int main(int argc, char **argv) { if (treeresult->tree != NULL) { subtree = new Gtk_Tree(*treeresult->tree); printf("inserting %s into root\n", base_dn); - treeitem->set_subtree(subtree); + treeitem->set_subtree(*subtree); } treeitem->show(); window->scroller->add(tree); -- 2.39.5