Re: [pygtk] make a ListStore to sort itself

2007-01-30 Thread Florian Diesch
"Volker Helm" <[EMAIL PROTECTED]> wrote:

>
> Bye,
>
> Volker
>
>  Original-Nachricht 
> Datum: Fri, 26 Jan 2007 23:24:10 +0100
> Von: Florian Diesch <[EMAIL PROTECTED]>
> An: pygtk@daa.com.au
> Betreff: Re: [pygtk] make a ListStore to sort itself
>
>> "Volker Helm" <[EMAIL PROTECTED]> wrote:
>> 
>> >> I have a sorted ListStore containing values that change themself. After
>> >> a change I want to sort it again.
>> >> 
>> >> So far I'm doing it by calling set_sort_column_id() with a different
>> >> sort_column_id or order and then calling it again with the right
>> values.
>> >> 
>> >> Is there a better way? 
>> >> 
>> >> Calling row_changed() or sort_column_changed() doesn't work and using
>> >> set(), remove() etc. is difficult as the values don't know to which row
>> >> they belong.
>> >
>> > just use gtk.TreeModelSort(model).
>> >
>> > There is an example in the tutorial
>> >
>> http://www.pygtk.org/pygtk2tutorial/sec-TreeModelSortAndTreeModelFilter.html
>> >
>> > Hope that will help,
>> >
>> 
>> I don't understand how to do it as I can't tell TreeModelSort to resort
>> itself or its  child model.
>
> These are the magical lines:
>
> win.sm = gtk.TreeModelSort(self.liststore)
> # Set sort column
> win.sm.set_sort_column_id(n, gtk.SORT_ASCENDING)
> win.tv = gtk.TreeView(win.sm)
>
> So, when you insert a line into the model, now win.sm, with sorting
> column n, the row sorting itself. That was the way as I understood it.

My problem is that I don't insert new rows but just get noticed that
some value in an existing row has been changed.





   Florian
-- 
<http://www.florian-diesch.de/>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] make a ListStore to sort itself

2007-01-29 Thread Volker Helm
These are the magical lines:

win.sm = gtk.TreeModelSort(self.liststore)
# Set sort column
win.sm.set_sort_column_id(n, gtk.SORT_ASCENDING)
win.tv = gtk.TreeView(win.sm)

So, when you insert a line into the model, now win.sm, with sorting column n, 
the row sorting itself. That was the way as I understood it.

Bye,

Volker

 Original-Nachricht 
Datum: Fri, 26 Jan 2007 23:24:10 +0100
Von: Florian Diesch <[EMAIL PROTECTED]>
An: pygtk@daa.com.au
Betreff: Re: [pygtk] make a ListStore to sort itself

> "Volker Helm" <[EMAIL PROTECTED]> wrote:
> 
> >> I have a sorted ListStore containing values that change themself. After
> >> a change I want to sort it again.
> >> 
> >> So far I'm doing it by calling set_sort_column_id() with a different
> >> sort_column_id or order and then calling it again with the right
> values.
> >> 
> >> Is there a better way? 
> >> 
> >> Calling row_changed() or sort_column_changed() doesn't work and using
> >> set(), remove() etc. is difficult as the values don't know to which row
> >> they belong.
> >
> > just use gtk.TreeModelSort(model).
> >
> > There is an example in the tutorial
> >
> http://www.pygtk.org/pygtk2tutorial/sec-TreeModelSortAndTreeModelFilter.html
> >
> > Hope that will help,
> >
> 
> I don't understand how to do it as I can't tell TreeModelSort to resort
> itself or its  child model.

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] make a ListStore to sort itself

2007-01-27 Thread Florian Diesch
"Volker Helm" <[EMAIL PROTECTED]> wrote:

>> I have a sorted ListStore containing values that change themself. After
>> a change I want to sort it again.
>> 
>> So far I'm doing it by calling set_sort_column_id() with a different
>> sort_column_id or order and then calling it again with the right values.
>> 
>> Is there a better way? 
>> 
>> Calling row_changed() or sort_column_changed() doesn't work and using
>> set(), remove() etc. is difficult as the values don't know to which row
>> they belong.
>
> just use gtk.TreeModelSort(model).
>
> There is an example in the tutorial
> http://www.pygtk.org/pygtk2tutorial/sec-TreeModelSortAndTreeModelFilter.html
>
> Hope that will help,
>

I don't understand how to do it as I can't tell TreeModelSort to resort
itself or its  child model.

But I can use set_sort_func() to resort the ListStore which works for
me.


   Florian
-- 

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Re: [pygtk] make a ListStore to sort itself

2007-01-15 Thread Volker Helm
Hi Florian,

just use gtk.TreeModelSort(model).

There is an example in the tutorial
http://www.pygtk.org/pygtk2tutorial/sec-TreeModelSortAndTreeModelFilter.html

Hope that will help,

Volker

 Original-Nachricht 
Datum: Sat, 13 Jan 2007 02:27:34 +0100
Von: Florian Diesch <[EMAIL PROTECTED]>
An: pygtk@daa.com.au
Betreff: [pygtk] make a ListStore to sort itself

> 
> Hi!
> 
> I have a sorted ListStore containing values that change themself. After
> a change I want to sort it again.
> 
> So far I'm doing it by calling set_sort_column_id() with a different
> sort_column_id or order and then calling it again with the right values.
> 
> Is there a better way? 
> 
> Calling row_changed() or sort_column_changed() doesn't work and using
> set(), remove() etc. is difficult as the values don't know to which row
> they belong.
> 
> 
> 
>Florian
> -- 
> <http://www.florian-diesch.de/>
> ___
> pygtk mailing list   pygtk@daa.com.au
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


[pygtk] make a ListStore to sort itself

2007-01-13 Thread Florian Diesch

Hi!

I have a sorted ListStore containing values that change themself. After
a change I want to sort it again.

So far I'm doing it by calling set_sort_column_id() with a different
sort_column_id or order and then calling it again with the right values.

Is there a better way? 

Calling row_changed() or sort_column_changed() doesn't work and using
set(), remove() etc. is difficult as the values don't know to which row
they belong.



   Florian
-- 

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/