Re: How do I move rows up or down in a Gtk::ListViewText



On 28/05/13 01:23, Juan Angel Moreno wrote:
You don't need to delete and re-insert rows, you only have to call move(src, dest) with the iterator of the row you want to move as src and the iterator of the row where you want to put it as dest.

I used iter_swap in the end works like a charm thanks guys



Greetings


2013/5/27 Kevin Brightwell <kevin brightwell2 gmail com>
I haven't used gtkmm in awhile, but if I recall there are iterator methods for keeping state, and there should be insert methods. So in pseudo-code:

  1. Get currently selected row, save in curRow [1]
  2. Delete curRow from Gtk::ListView, keep it in memory, though
  3. Re-insert curRow at desired position [2]

Hope that helps.

Kevin

[1] https://developer.gnome.org/gtkmm-tutorial/3.4/sec-treeview-selection.html.en

[2] https://developer.gnome.org/gtkmm/stable/classGtk_1_1ListStore.html#ab71d860741465ea79bc352c4575e47ec



On Mon, May 27, 2013 at 10:35 AM, Francis (Grizzly) Smit <grizzly smit id au> wrote:
yep I'm now trying to move the selected row up or down in a
Gtk::ListViewText but not sure how to do it
thx in advance for any help.


--


  .~.     In my life God comes first....
  /V\         but Linux is pretty high after that :-D
 /( )\    Francis (Grizzly) Smit
 ^^-^^    http://www.smit.id.au/

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list



--
Kevin Brightwell
BESc. and BSc. Candidate 2015
Western University www.westernu.ca
e. kevin brightwell2 gmail com c. 226.678.4927

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list




--
Atentamente:
Juan Ángel Moreno Fernández
jamf gm gmail com
------------------------------
  Proyecto Gelide
  http://gelide.sf.net
------------------------------


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list


--

  .~.     In my life God comes first.... 
  /V\         but Linux is pretty high after that :-D
 /( )\    Francis (Grizzly) Smit
 ^^-^^    http://www.smit.id.au/


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