]> git.sur5r.net Git - openldap/commitdiff
A few quick fixes to get it up to speed with latest Gtk-- version and finally make...
authorPredrag "Pele" Balorda <pele@openldap.org>
Thu, 26 Nov 1998 12:21:23 +0000 (12:21 +0000)
committerPredrag "Pele" Balorda <pele@openldap.org>
Thu, 26 Nov 1998 12:21:23 +0000 (12:21 +0000)
contrib/gtk-tool/Gtk_LdapTreeItem.cc
contrib/gtk-tool/My_Scroller.cc
contrib/gtk-tool/My_Window.cc
contrib/gtk-tool/main.cc

index a7d0e1b43bd73aecab9cce04c3524d2bb383b6a8..baaba0417466df77dbaddef7eeafa3a2665cea2f 100644 (file)
@@ -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();
                }
index 0f73c8abf2bf29521e46b8f60ba2109a0bceba17..19c4da22e8a21b106de64b1834f9439d9fc6fe9f 100644 (file)
@@ -3,11 +3,13 @@
 #include <gtk--/container.h>
 
 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) {
index 38d433b0c52fd73b0dd10ac2b4a3523db1cce322..0b1eabafea1469d935ff95199b2d0a5d3a9d2462 100644 (file)
@@ -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();
index c5dfb272d3de2586300d16fb7ff7207b5f9a5b06..40a9ef50293693dc831b8be48ef3e69b4ed59fc9 100644 (file)
@@ -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);