Re: [pygtk] TreeStore append/set

2002-07-03 Thread Jonathan Blandford

Andreas Rottmann <[EMAIL PROTECTED]> writes:

> Hi!
> 
> I'm just porting an application from Gtk-- 1.2 to gnome-python from
> CVS. I want to use the new TreeStore/TreeView interface instead of
> CTree. However, when I want to append a row in the tree, it is added
> in the view, but the contents are not set/displayed.
> 
> I use something like this code sequence:
> 
> model = gtk.TreeStore(gobject.TYPE_STRING)
> 
> view = gtk.TreeView(model)
> renderer = gtk.CellRendererText()
> column = gtk.TreeViewColumn("Connection", renderer)

try:
column = gtk.TreeViewColumn("Connection", renderer, text=0)

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



[pygtk] TreeStore append/set

2002-07-03 Thread Andreas Rottmann

Hi!

I'm just porting an application from Gtk-- 1.2 to gnome-python from
CVS. I want to use the new TreeStore/TreeView interface instead of
CTree. However, when I want to append a row in the tree, it is added
in the view, but the contents are not set/displayed.

I use something like this code sequence:

model = gtk.TreeStore(gobject.TYPE_STRING)

view = gtk.TreeView(model)
renderer = gtk.CellRendererText()
column = gtk.TreeViewColumn("Connection", renderer)
view.append_column(column)

it = model.append(None)
model.set(it, 0, "foobar", -1)

Regards & Thx, Andy
-- 
Andreas Rottmann | Rotty@ICQ| 118634484@ICQ | [EMAIL PROTECTED]
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint  | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62
___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



Re: [pygtk] Help with adding a new function

2002-07-03 Thread Mathew Yeates

Thx James. That handles this specific case. But, I'd also like to do it 
for other functions to.

Mathew

James Henstridge wrote:

> Mathew Yeates wrote:
>
>> Hi,
>> I've looked at how draw_rgb is implemented and I'd like to create a 
>> similar
>> function which passes a Numeric array. Rather than modify the pygtk 
>> code (which
>> I've done in the past), I'd like
>> to have my own code outside the gnome-python source tree. 
>
>
> There is already a draw_array() variant that can take Numeric Python 
> arrays (only compiled if Numeric Python was found when pygtk was 
> building).  It takes an NxM, NxMx1, NxMx3 or NxMx4 unsigned byte array 
> and renders it to the drawable.
>
> (I haven't ported this to the pygtk2 tree yet though).
>
> James.
>


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