Re: [pygtk] Trouble with TreeViews

2007-11-11 Thread Yann Leboulanger

Caleb Marcus a écrit :
I've read those, but I can't quite understand how to get it to work. 
I've attached a glade XML file and a Python file that I'm using to test 
the ability to manipulate TreeViews in Python. I'm just trying to get 
"Column1text" into the first column, and the number 2 into the second 
column, but it's not working... could anyone help me get this figured 
out? If you're running it, you'll need python-glade, and both files will 
need to be in the same directory.

On Sun, 2007-11-11 at 19:21 +0100, Gian Mario Tagliaretti wrote:

2007/11/11, Caleb Marcus <[EMAIL PROTECTED] >:
>
>  I'm pretty new to Python, and days-new to GTK, and the TreeView widget is
> confusing the hell out of me... is there a good guide to using it?

the pygtk tutorial has got a section dedicated to the treeview widget:
http://www.pygtk.org/pygtk2tutorial/ch-TreeViewWidget.html

also check the pygtk FAQ:
http://faq.pygtk.org/index.py?req=index

cheers





___
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/


replace text=1 and text=2 by text=0 and text=1

--
Yann
___
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] DrawingArea and mouse events

2007-11-11 Thread Donn
> If you want to implement yet another canvas (please don't) have a look
> at the source code of a good canvas and get inspiration (and code)
> from there.
Well, the reason I asked in this list was to garner suggestions based on 
PyGTK. So far the canvases I've looked at are in C. But I'll take your hint 
and do it myself, restricting questions on the list to specific code.

\d
___
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] Trouble with TreeViews

2007-11-11 Thread Caleb Marcus
Aha, I figured out what I did wrong.
On Sun, 2007-11-11 at 17:02 -0500, Caleb Marcus wrote:

> I've read those, but I can't quite understand how to get it to work.
> I've attached a glade XML file and a Python file that I'm using to
> test the ability to manipulate TreeViews in Python. I'm just trying to
> get "Column1text" into the first column, and the number 2 into the
> second column, but it's not working... could anyone help me get this
> figured out? If you're running it, you'll need python-glade, and both
> files will need to be in the same directory.
> On Sun, 2007-11-11 at 19:21 +0100, Gian Mario Tagliaretti wrote: 
> 
> > 2007/11/11, Caleb Marcus <[EMAIL PROTECTED]>:
> > >
> > >  I'm pretty new to Python, and days-new to GTK, and the TreeView widget is
> > > confusing the hell out of me... is there a good guide to using it?
> > 
> > the pygtk tutorial has got a section dedicated to the treeview widget:
> > http://www.pygtk.org/pygtk2tutorial/ch-TreeViewWidget.html
> > 
> > also check the pygtk FAQ:
> > http://faq.pygtk.org/index.py?req=index
> > 
> > cheers


signature.asc
Description: This is a digitally signed message part
___
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] Trouble with TreeViews

2007-11-11 Thread Caleb Marcus
I've read those, but I can't quite understand how to get it to work.
I've attached a glade XML file and a Python file that I'm using to test
the ability to manipulate TreeViews in Python. I'm just trying to get
"Column1text" into the first column, and the number 2 into the second
column, but it's not working... could anyone help me get this figured
out? If you're running it, you'll need python-glade, and both files will
need to be in the same directory.
On Sun, 2007-11-11 at 19:21 +0100, Gian Mario Tagliaretti wrote:

> 2007/11/11, Caleb Marcus <[EMAIL PROTECTED]>:
> >
> >  I'm pretty new to Python, and days-new to GTK, and the TreeView widget is
> > confusing the hell out of me... is there a good guide to using it?
> 
> the pygtk tutorial has got a section dedicated to the treeview widget:
> http://www.pygtk.org/pygtk2tutorial/ch-TreeViewWidget.html
> 
> also check the pygtk FAQ:
> http://faq.pygtk.org/index.py?req=index
> 
> cheers


test.glade
Description: application/glade
#!/usr/bin/env python
import gtk, gtk.glade, sys
gladexml = gtk.glade.XML('test.glade')
gtklist = gladexml.get_widget('treeview1')
gtklist.append_column(gtk.TreeViewColumn("Column1", gtk.CellRendererText(), text=1))
gtklist.append_column(gtk.TreeViewColumn("Column2", gtk.CellRendererText(), text=2))
gtklistmodel = gtk.ListStore(str, int)
gtklist.set_model(gtklistmodel)
gtklistmodel.append(['Column1text', 2])
gtk.main()


signature.asc
Description: This is a digitally signed message part
___
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] Trouble with TreeViews

2007-11-11 Thread Gian Mario Tagliaretti
2007/11/11, Caleb Marcus <[EMAIL PROTECTED]>:
>
>  I'm pretty new to Python, and days-new to GTK, and the TreeView widget is
> confusing the hell out of me... is there a good guide to using it?

the pygtk tutorial has got a section dedicated to the treeview widget:
http://www.pygtk.org/pygtk2tutorial/ch-TreeViewWidget.html

also check the pygtk FAQ:
http://faq.pygtk.org/index.py?req=index

cheers
-- 
Gian Mario Tagliaretti
___
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] Trouble with TreeViews

2007-11-11 Thread Caleb Marcus
I'm pretty new to Python, and days-new to GTK, and the TreeView widget
is confusing the hell out of me... is there a good guide to using it?


signature.asc
Description: This is a digitally signed message part
___
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] DrawingArea and mouse events

2007-11-11 Thread Gian Mario Tagliaretti
2007/11/9, Donn <[EMAIL PROTECTED]>:

> Okay. It seems I am writing my own canvas then. I am stuck on GTL+2.8 for a
> bunch of reasons so I have not been able to run any of the popular canvas
> apps.

If you are stuck with 2.8 you should try GnomeCanvas then, it doesn't
use cairo for rendering though,

> I hope someone can point me in the direction of how to calculate when an x,y
> is within the area of an object - based on it's closed-path shape not a
> general bounding area. That's something I am all at sea about.

If you want to implement yet another canvas (please don't) have a look
at the source code of a good canvas and get inspiration (and code)
from there.

cheers
-- 
Gian Mario Tagliaretti
___
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/