[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: How do I move rows up or down in a Gtk::ListViewText
From:       Kevin Brightwell <kevin.brightwell2 () gmail ! com>
Date:       2013-05-27 15:28:46
Message-ID: CAE=CFxVc19ALNvMqmawL0=WabC7wBr9cRkq4ZEG2kbnm7bnXBA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I was going from memory, now I see there is the move(src, dest) operation.
Good pick.

Cheers,

Kevin


On Mon, May 27, 2013 at 11:23 AM, Juan Angel Moreno <jamf.gm@gmail.com>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.
>
> 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 <http://www.uwo.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
> ------------------------------
>



-- 
Kevin Brightwell
*BESc. and BSc. Candidate 2015*
Western University www.westernu.ca <http://www.uwo.ca>
e. kevin.brightwell2@gmail.com c. 226.678.4927

[Attachment #5 (text/html)]

<div dir="ltr"><div><div>I was going from memory, now I see there is the <span \
style="font-family:courier new,monospace">move(src, dest)</span> operation. Good \
pick.<br><br></div>Cheers,<br><br></div>Kevin<br></div><div class="gmail_extra"> \
<br><br><div class="gmail_quote">On Mon, May 27, 2013 at 11:23 AM, Juan Angel Moreno \
<span dir="ltr">&lt;<a href="mailto:jamf.gm@gmail.com" \
target="_blank">jamf.gm@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <div dir="ltr"><div>You don&#39;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.<br>

<br></div>Greetings<br></div><div class="gmail_extra"><div><div \
class="h5"><br><br><div class="gmail_quote">2013/5/27 Kevin Brightwell <span \
dir="ltr">&lt;<a href="mailto:kevin.brightwell2@gmail.com" \
target="_blank">kevin.brightwell2@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr"><div>I haven&#39;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:<br>

<br><ol><li>Get currently selected row, save in <b>curRow </b>[1]<br>
</li><li>Delete <b>curRow</b> from Gtk::ListView, keep it in memory, \
though</li><li>Re-insert <b>curRow </b>at desired position [2]<br></li></ol><p>Hope \
that helps.</p><p>Kevin</p><p>[1] <a \
href="https://developer.gnome.org/gtkmm-tutorial/3.4/sec-treeview-selection.html.en" \
target="_blank">https://developer.gnome.org/gtkmm-tutorial/3.4/sec-treeview-selection.html.en</a></p>



<p>[2] <a href="https://developer.gnome.org/gtkmm/stable/classGtk_1_1ListStore.html#ab71d860741465ea79bc352c4575e47ec" \
target="_blank">https://developer.gnome.org/gtkmm/stable/classGtk_1_1ListStore.html#ab71d860741465ea79bc352c4575e47ec</a><br>



</p></div></div><div class="gmail_extra"><div><div><br><br><div \
class="gmail_quote">On Mon, May 27, 2013 at 10:35 AM, Francis (Grizzly) Smit <span \
dir="ltr">&lt;<a href="mailto:grizzly@smit.id.au" \
target="_blank">grizzly@smit.id.au</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">yep I&#39;m now trying to move the selected row up or down in \
a<br> Gtk::ListViewText but not sure how to do it<br>
thx in advance for any help.<br>
<span><font color="#888888"><br>
<br>
--<br>
<br>
<br>
  .~.     In my life God comes first....<br>
  /V\         but Linux is pretty high after that :-D<br>
 /( )\    Francis (Grizzly) Smit<br>
 ^^-^^    <a href="http://www.smit.id.au/" \
target="_blank">http://www.smit.id.au/</a><br> <br>
_______________________________________________<br>
gtkmm-list mailing list<br>
<a href="mailto:gtkmm-list@gnome.org" target="_blank">gtkmm-list@gnome.org</a><br>
<a href="https://mail.gnome.org/mailman/listinfo/gtkmm-list" \
target="_blank">https://mail.gnome.org/mailman/listinfo/gtkmm-list</a><br> \
</font></span></blockquote></div><br><br clear="all"><br></div></div><span><font \
color="#888888">-- <br><div dir="ltr">Kevin Brightwell<br><i>BESc. and BSc. Candidate \
2015</i><br>Western University <a href="http://www.uwo.ca" \
target="_blank">www.westernu.ca</a><br>


e. <a href="mailto:kevin.brightwell2@gmail.com" \
target="_blank">kevin.brightwell2@gmail.com</a> c. <a href="tel:226.678.4927" \
value="+12266784927" target="_blank">226.678.4927</a><br></div> </font></span></div>
<br>_______________________________________________<br>
gtkmm-list mailing list<br>
<a href="mailto:gtkmm-list@gnome.org" target="_blank">gtkmm-list@gnome.org</a><br>
<a href="https://mail.gnome.org/mailman/listinfo/gtkmm-list" \
target="_blank">https://mail.gnome.org/mailman/listinfo/gtkmm-list</a><br> \
<br></blockquote></div><br><br clear="all"><br>-- <br></div></div><div \
class="im">Atentamente:<br>Juan Ángel Moreno Fernández<br><a \
href="mailto:jamf.gm@gmail.com" \
target="_blank">jamf.gm@gmail.com</a><br>------------------------------<br>  Proyecto \
Gelide <br>  <a href="http://gelide.sf.net" \
                target="_blank">http://gelide.sf.net</a><br>
------------------------------
</div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Kevin \
Brightwell<br><i>BESc. and BSc. Candidate 2015</i><br>Western University <a \
href="http://www.uwo.ca" target="_blank">www.westernu.ca</a><br>e. <a \
href="mailto:kevin.brightwell2@gmail.com" \
target="_blank">kevin.brightwell2@gmail.com</a> c. 226.678.4927<br> </div>
</div>



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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic