TreeView - First element



Hello all,
How can I check that the selected element on TreeView is first or last?

I have that code:

File.H
...
Gtk::TreeView ListTreeView;
Gtk::TreeModel::Row row;
Glib::RefPtr<Gtk::ListStore> ListTreeModel;
...

File.CPP
...  THIS CODE MOVE ELEMENT UP
Glib::RefPtr<Gtk::TreeSelection> ref = ListTreeView.get_selection();
Gtk::TreeModel::iterator iter = ref->get_selected();

if (ListTreeModel->children().begin() != iter)
ListTreeModel->iter_swap(iter, iter--); // But if iter is the first element from the list the code isn't work properly
...




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]