Thanks for your reply,

is it also possible to do it like this?

import gtk.MainWindow;
import gtk.Box;
import gtk.Main;

import gtk.Button;
import gdk.Event;
import gtk.Widget;

import List, Languages;

void main(string[] args){
        Main.init(args);
        MainWindow win = new MainWindow("TreeView Example");
        win.setDefaultSize(500,300);

        Box box = new Box(Orientation.VERTICAL, 0);

        auto list = new List();
        auto german = list.addCountry("German", "Germany");
        auto city = list.addCountryCity(german, "German", "Munich");

        auto sweden = list.addCountry("Swedish", "Sweden");
        auto cit = list.addCountryCity(sweden, "Swedish", "Stockholm");

        auto treeView = new LanguageTree(list);

        auto btn_Delete = new DeleteButton("Delete", treeView, list);
        box.packStart(treeView, true, true, 0);
        box.add(btn_Delete);

        win.add(box);
        win.showAll();
        Main.run();
}

class DeleteButton : Button
{
        private LanguageTree mLT;
        private List mTStore;
        this(in string text, LanguageTree lT, List tStore){
                super(text);
                this.mLT = lT;
                this.mTStore = tStore;
                addOnButtonRelease(&del);
        }
        private bool del(Event event, Widget widget){

                mTStore.remove(mLT.getSelectedIter);
                return true;
        }
}

and in my TreeStore-Class:

        public void remove(TreeIter iter)
        {
                rowDeleted(iter);
        }

but now i get the error:

"rowDeleted is not callable using argument types (TreeIter)"?


Reply via email to