A Sex, 2003-08-15 ŕs 22:58, László Monda escreveu:
> Hi List,
> 
> As the subject says...
> 
> Problem #1: I can't make an arbitrary row active in a CList.

  Sorry, I don't use CList; it is deprecated.  You should be using
gtk.ListStore/gtk.TreeView.

> 
> `select_row' seemed to be fine, but I realized when I changed position
> using the keyboard after the call, that the actual position remains
> the same.
> 
> I know about a workaround, more precisely moving the actual row into a
> new position with `row_move' or `swap_rows', and swapping the contents
> of the rows, but a cleaner way should be better.
> 
> BTW, is there any way to make the active selection disappear and
> emulating it with colorized row background?
> Or should I write my own CList? ;)
> 
> 
> Problem #2: This code below doesn't work as expected:
> 
> s = '/-\|'
> 
> for i in range(1, 100):
>     my_silly_label.set_text(s[i % 4])
>     time.sleep(0.1)
> 
> In this example `my_silly_label' (which is a `Label' as you might
> guess :) doesn't get refreshed in the loop, but right after that.

  No, this woudn't work.  You have to use timeouts.  When calling
time.sleep(), gtk becomes blocked and doesn't update the gui.  Some code
to do what you want would be:

def timeout_func(data):
        itr, label = data
        i = itr.next()
        label.set_text(s[i % 4])
        return True
gobject.timeout_add(100, timeout_func, (iter(xrange(1, 100)), label))

> 
> 
> Thank you for your time,
> 
> --
> 
>     Laci
> 
> Please sign http://noepatents.org against software patents in Europe!
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
> Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to