Re: No of rows in a TreeView Widget



On 4/18/07, SaiKamesh Rathinasabapathy <rsaikamesh gmail com> wrote:
Hi,

Thank you Very much for helping me to find out the no of records in a
treeview. I have to do lot of things with the treeview. Please give me some
ideas to do the following. I don't know how to do the following. I don't
even have a clue. please help me!

I have added a treeview in a window and at the left side of the treeview I
have added some butons
named as
GoNext,GoPrevious,GoToFirstRecord,GoToLastRecord,GoTop,GoBottom,

if GoNext button is clicked then the current cursor position of the treeview
should be changed to  next row.

I haven't tested any of these, so there may be mistakes in them, but
it should be something like this:
Glib::RefPtr<Gtk::TreeSelection> selection = tree_view.get_selection ();
selection->select (++selection->get_selected ())

if GoPrevious button is clicked then the current cursor position of the
treeview should be changed to previous row.

Glib::RefPtr<Gtk::TreeSelection> selection = tree_view.get_selection ();
selection->select (--selection->get_selected ())

if GoToFirstRecord button is clicked then the current cursor position of the
treeview should be changed to the very first row of the treeview.

Glib::RefPtr<Gtk::TreeSelection> selection = tree_view.get_selection ();
selection->select (tree_view->children ().begin())

if GoToLastRecord button is clicked then the current cursor position of the
treeview should be changed to the last row of the treeview.

Glib::RefPtr<Gtk::TreeSelection> selection = tree_view.get_selection ();
selection->select (tree_view->children ().rbegin())

if GoTop button is clicked then the current cursor position of the treeview
should be changed to the top row of the page(not top row of the treeview).

if GoBottom button is clicked then the current cursor position of the
treeview should be changed to the bottom row of the page(not the bottom row
of the treeview).

I'm not sure about these off the top of my head.  Hopefully you have
enough information now that you can experiment on your own and figure
it out.  good luck.

--
jonner



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