Re: [pygtk] list like behaviour for GtkListStore

2002-07-13 Thread James Henstridge

Christian Reis wrote:

>On Sat, Jul 13, 2002 at 12:36:35PM +0800, James Henstridge wrote:
>  
>
>>I added a quick modification to the GtkListStore wrapper so the 
>>following is now possible:
>>
>> >>> import gtk
>> >>> store = gtk.ListStore(int, int, str, str)
>> >>> store.append()
>>
>>
>>
>
>Will append() take arguments? I found this a bit odd in the API.
>
I have been considering it.  It is probably a good idea, as it gives 
better compatibility with python lists.

>>* support for this to GtkTreeStore (so you could do
>>  treestore[0,3][0] = 42)
>>
>>
>
>[0,3] - is this like Numeric uses?
>

It represents a tree path.  store[0] - store[n] are the top level nodes 
in the tree.  store[0,0] - store[0,n] are the children of the first 
node.  store[0,1,0] - store[0,1,n] are the children of the second child 
of the first toplevel node.  So store[0,3] represents the forth child of 
the first toplevel node.

>>* support for assignments (eg. store[0] = (1,2,'foo','bar'))
>>
>>
>
>Yep, looks cool.
>
>I don't know iterators very well, not enough to comment.
>  
>

James.

-- 
Email: [EMAIL PROTECTED]  | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html




___
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] Re: list like behaviour for GtkListStore

2002-07-13 Thread James Henstridge

Jonathan Blandford wrote:

>James Henstridge <[EMAIL PROTECTED]> writes:
>
>  
>
>>I added a quick modification to the GtkListStore wrapper so the
>>following is now possible:
>>
>> >>> import gtk
>> >>> store = gtk.ListStore(int, int, str, str)
>>
>>
>
>nice.  Can I do 'object' too?
>
Yes.  'object' gets interpreted as 'arbitrary python object'.

>>I plan to add some more features:
>>
>>* support for this to GtkTreeStore (so you could do
>>  treestore[0,3][0] = 42)
>>
This bit is working now :)

>>* support for row deletion
>>* support for assignments (eg. store[0] = (1,2,'foo','bar'))
>>* an __iter__ slot for GtkListStore (which would return a sequence
>>  ofthese row objects).
>>* maybe add __iter__ for tree stores too (iterates over the toplevel
>>  nodes, and iter(row) would iterate over the child nodes).
>>
>>
>
>so it would be:
>for row in tree:
>for row2 in row:
>...
>
>I kinda would have expected that to iterate over values.  This may be
>more convenient, though.
>
Either that, or do:
  for row2 in row.iterchildren(): ...

This would be similar to dictionaries where there is more than one thing 
that you may want to iterate over:

* iter(d) iterates over keys
* d.iterkeys() iterates over keys
* d.itervalues() iterates over values
* d.iteritems() iterates over (key, value) pairs

So having an iterchildren() method for row objects would fit this 
pattern pretty well.

James.

-- 
Email: [EMAIL PROTECTED]  | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html




___
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] list like behaviour for GtkListStore

2002-07-13 Thread Christian Reis

On Sat, Jul 13, 2002 at 12:36:35PM +0800, James Henstridge wrote:
> I added a quick modification to the GtkListStore wrapper so the 
> following is now possible:
> 
>  >>> import gtk
>  >>> store = gtk.ListStore(int, int, str, str)
>  >>> store.append()
> 

Will append() take arguments? I found this a bit odd in the API.

> * support for this to GtkTreeStore (so you could do
>   treestore[0,3][0] = 42)

[0,3] - is this like Numeric uses?

> * support for assignments (eg. store[0] = (1,2,'foo','bar'))

Yep, looks cool.

I don't know iterators very well, not enough to comment.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] FAQ links

2002-07-13 Thread Shandy Brown

yeah, that makes sense in the context.  plus it gives users a little
more information.

On Sat, 2002-07-13 at 13:34, Christian Reis wrote:
> On Sat, Jul 13, 2002 at 01:26:41PM -0400, Shandy Brown wrote:
> > I know it's kind of AOLish, but I think "click here" would fit more
> > naturally into some of the contexts than "link".
> 
> "click here" doesn't take into account people using text or
> text-to-voice browsers, so it's bad accessibility. I'm trying out
> [www.hostname.where.link.is] - check it out and see if you like it.
> 
> Take care,
> --
> Christian Reis, Senior Engineer, Async Open Source, Brazil.
> http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL




signature.asc
Description: This is a digitally signed message part


Re: [pygtk] FAQ links

2002-07-13 Thread Christian Reis

On Sat, Jul 13, 2002 at 01:26:41PM -0400, Shandy Brown wrote:
> I know it's kind of AOLish, but I think "click here" would fit more
> naturally into some of the contexts than "link".

"click here" doesn't take into account people using text or
text-to-voice browsers, so it's bad accessibility. I'm trying out
[www.hostname.where.link.is] - check it out and see if you like it.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] FAQ links

2002-07-13 Thread Shandy Brown

I know it's kind of AOLish, but I think "click here" would fit more
naturally into some of the contexts than "link".

Shandy

On Sat, 2002-07-13 at 11:21, Christian Reis wrote:
> 
> I've been messing with faqwiz the past days to make it nicer. I've made
> the following changes:
> 
> a) Starting a line with a "-" character makes a list item out of it, and if
> you place many in a sequence, they are grouped into a single 
> 
> b) I've substituted the anchor for URLs for the string "[link]".
> 
> Is everybody okay with these, specially b)? I didn't like the URLs
> wrapping all over the place, but I'm not sure [link] is very nice
> either.
> 
> Please try out the FAQ and let me know what you think of the changes.
> There might even be bugs :-)
> 
> Take care,
> --
> Christian Reis, Senior Engineer, Async Open Source, Brazil.
> http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
> ___
> 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 mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/



[pygtk] Re: list like behaviour for GtkListStore

2002-07-13 Thread Jonathan Blandford

James Henstridge <[EMAIL PROTECTED]> writes:

> I added a quick modification to the GtkListStore wrapper so the
> following is now possible:
> 
>  >>> import gtk
>  >>> store = gtk.ListStore(int, int, str, str)

nice.  Can I do 'object' too?

>  >>> store.append()
> 
>  >>> len(store)
> 1
>  >>> store[0]
> 
>  >>> store[0][0]
> 0
>  >>> store[0][0] = 42
>  >>> store[0][2] = 'foo'
>  >>> store[0][0], store[0][2]
> 42, 'foo'

Looks really nice.

> I plan to add some more features:
> 
> * support for this to GtkTreeStore (so you could do
>   treestore[0,3][0] = 42)
> * support for row deletion
> * support for assignments (eg. store[0] = (1,2,'foo','bar'))
> * an __iter__ slot for GtkListStore (which would return a sequence
>   ofthese row objects).
> * maybe add __iter__ for tree stores too (iterates over the toplevel
>   nodes, and iter(row) would iterate over the child nodes).

so it would be:
for row in tree:
for row2 in row:
...

I kinda would have expected that to iterate over values.  This may be
more convenient, though.

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] FAQ links

2002-07-13 Thread Christian Reis


I've been messing with faqwiz the past days to make it nicer. I've made
the following changes:

a) Starting a line with a "-" character makes a list item out of it, and if
you place many in a sequence, they are grouped into a single 

b) I've substituted the anchor for URLs for the string "[link]".

Is everybody okay with these, specially b)? I didn't like the URLs
wrapping all over the place, but I'm not sure [link] is very nice
either.

Please try out the FAQ and let me know what you think of the changes.
There might even be bugs :-)

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
___
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] pygtk - gtkglext

2002-07-13 Thread James Henstridge

Ben Hines wrote:

>
> On Saturday, July 13, 2002, at 03:28  AM, James Henstridge wrote:
>
>> Ben Hines wrote:
>>
>>> I assume this is because gtkgl 2.0 does not exist: (no gtkglarea for 
>>> gtk2)
>>>
>>> checking for gtkgl-2.0 >= 1.99.0... Package gtkgl-2.0 was not found 
>>> in the pkg-config search path.
>>> Perhaps you should add the directory containing `gtkgl-2.0.pc'
>>>
>>> Perhaps pygtk2 could use the new gtkglext instead. gtkglext is an 
>>> OpenGL extention to GTK 2.0 or later.
>>>
>>>  It is available at
>>>
>>> http://gtkglext.sf.net/
>>
>>
>> You can get gtkglarea at 
>> http://www.gnome.org/pub/GNOME/earthquake/sources/gtkglarea/
>>
>
> 1. Thats a bad URL.
> 2. Not 2.0. There does seem to be some gtkglarea 2 stuff at 
> http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=gtkglarea 
> , but I can't find a simple tarball of gtkglarea2.

Sorry.  That was supposed to be:
http://ftp.gnome.org/pub/GNOME/earthquake/sources/gtkglarea/

James.

-- 
Email: [EMAIL PROTECTED]  | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html




___
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] pygtk - gtkglext

2002-07-13 Thread Ben Hines


On Saturday, July 13, 2002, at 03:57  AM, Ben Hines wrote:
>
> 1. Thats a bad URL.
> 2. Not 2.0. There does seem to be some gtkglarea 2 stuff at 
> http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=gtkglarea , 
> but I can't find a simple tarball of gtkglarea2.
>

Aha, nm i found it at 
ftp://ftp.belnet.be/mirror/ftp.gnome.org/pub/GNOME/earthquake/sources/gtkglarea/

-Ben

___
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] pygtk - gtkglext

2002-07-13 Thread Ben Hines


On Saturday, July 13, 2002, at 03:28  AM, James Henstridge wrote:

> Ben Hines wrote:
>
>> I assume this is because gtkgl 2.0 does not exist: (no gtkglarea for 
>> gtk2)
>>
>> checking for gtkgl-2.0 >= 1.99.0... Package gtkgl-2.0 was not found in 
>> the pkg-config search path.
>> Perhaps you should add the directory containing `gtkgl-2.0.pc'
>>
>> Perhaps pygtk2 could use the new gtkglext instead. gtkglext is an 
>> OpenGL extention to GTK 2.0 or later.
>>
>>  It is available at
>>
>> http://gtkglext.sf.net/
>
> You can get gtkglarea at 
> http://www.gnome.org/pub/GNOME/earthquake/sources/gtkglarea/
>

1. Thats a bad URL.
2. Not 2.0. There does seem to be some gtkglarea 2 stuff at 
http://cvs.gnome.org/bonsai/rview.cgi?cvsroot=/cvs/gnome&dir=gtkglarea , 
but I can't find a simple tarball of gtkglarea2.

-Ben

___
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] pygtk - gtkglext

2002-07-13 Thread James Henstridge

Ben Hines wrote:

> I assume this is because gtkgl 2.0 does not exist: (no gtkglarea for 
> gtk2)
>
> checking for gtkgl-2.0 >= 1.99.0... Package gtkgl-2.0 was not found in 
> the pkg-config search path.
> Perhaps you should add the directory containing `gtkgl-2.0.pc'
>
> Perhaps pygtk2 could use the new gtkglext instead. gtkglext is an 
> OpenGL extention to GTK 2.0 or later.
>
>  It is available at
>
> http://gtkglext.sf.net/

You can get gtkglarea at 
http://www.gnome.org/pub/GNOME/earthquake/sources/gtkglarea/

James.

-- 
Email: [EMAIL PROTECTED]  | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html




___
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] Plugs and Sockets

2002-07-13 Thread James Henstridge

John J Breen wrote:

>Hey,
>   I am having some trouble getting plugs and sockets to work
>correctly. I have visited
>http://www.gnome.org/~james/pygtk-docs/class-gtksocket.html
>to see the necessary calls I need to make but gtk.mysocket.get_id() does
>not seem to be working. It doesnt seem to be defined either, when I do a
>dir(a) where a is an instance of the socket class this method is not
>listed. Am I looking at old information for this? Where can I find the
>information I need to do some work with Plugs/Sockets?
>  
>
Try the new 1.99.11 version of pygtk.

James.

-- 
Email: [EMAIL PROTECTED]  | Linux.conf.au 2003 Call for Papers out
WWW:   http://www.daa.com.au/~james/ |   http://conf.linux.org.au/cfp.html




___
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] pygtk - gtkglext

2002-07-13 Thread Ben Hines

I assume this is because gtkgl 2.0 does not exist: (no gtkglarea for 
gtk2)

checking for gtkgl-2.0 >= 1.99.0... Package gtkgl-2.0 was not found in 
the pkg-config search path.
Perhaps you should add the directory containing `gtkgl-2.0.pc'

Perhaps pygtk2 could use the new gtkglext instead. gtkglext is an OpenGL 
extention to GTK 2.0 or later.

  It is available at

http://gtkglext.sf.net/

-Ben

___
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] Plugs and Sockets

2002-07-13 Thread John J Breen

Hey,
I am having some trouble getting plugs and sockets to work
correctly. I have visited
http://www.gnome.org/~james/pygtk-docs/class-gtksocket.html
to see the necessary calls I need to make but gtk.mysocket.get_id() does
not seem to be working. It doesnt seem to be defined either, when I do a
dir(a) where a is an instance of the socket class this method is not
listed. Am I looking at old information for this? Where can I find the
information I need to do some work with Plugs/Sockets?

Thanks
John Breen


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