Re: [pygtk] help with TreeStore

2006-06-10 Thread Benjamin Montgomery
On Sat, 2006-06-10 at 15:35 -0700, John Finlay wrote:
> If it is a Python object and not a PyGTK GObject then use 
> gobject.TYPE_PYOBJECT as the column type. gobject.TYPE_PYOBJECT will 
> also work for PyGTK GObjects as well.

gobject.TYPE_PYOBJECT works exactly as I wanted.  I missed it since it
isn't listed in the reference manual.

> You might want to file a bug since I figure that TreeStore and ListStore 
> should be able to accept an ordinary Python object as well.

I'll have to do some more experimenting...I don't know if I trust that
my module creates objects that have all of the attributes they are
supposed to.

Ben

-- 
Benjamin Montgomery <[EMAIL PROTECTED]>

___
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] help with TreeStore

2006-06-10 Thread John Finlay

Benjamin Montgomery wrote:

I need some help with TreeStore.  I'm trying to add an object that is
part of a module that I have written in C.  In my pygtk app I'm using:

gtk.TreeStore(gtk.TYPE_STRING, ..., myobject)

When this line gets executed, I get the error:

TypeError: could not get typecode from object

Does anyone know what I would need to add to my object to be able to put
it in to a treestore?

  
If it is a Python object and not a PyGTK GObject then use 
gobject.TYPE_PYOBJECT as the column type. gobject.TYPE_PYOBJECT will 
also work for PyGTK GObjects as well.


You might want to file a bug since I figure that TreeStore and ListStore 
should be able to accept an ordinary Python object as well.


John
___
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] help with TreeStore

2006-06-10 Thread Lawrence Oluyede

On 6/10/06, Benjamin Montgomery <[EMAIL PROTECTED]> wrote:

I need some help with TreeStore.  I'm trying to add an object that is
part of a module that I have written in C.  In my pygtk app I'm using:

gtk.TreeStore(gtk.TYPE_STRING, ..., myobject)


TreeStore constructor needs type specifiers. Try to pass
gtk.TYPE_OBJECT instead of myobject


--
Lawrence
http://www.oluyede.org/blog
___
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] help with TreeStore

2006-06-10 Thread Benjamin Montgomery
I need some help with TreeStore.  I'm trying to add an object that is
part of a module that I have written in C.  In my pygtk app I'm using:

gtk.TreeStore(gtk.TYPE_STRING, ..., myobject)

When this line gets executed, I get the error:

TypeError: could not get typecode from object

Does anyone know what I would need to add to my object to be able to put
it in to a treestore?

Thanks,
Ben

-- 
Benjamin Montgomery <[EMAIL PROTECTED]>

___
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] Combo Box problem..

2006-06-10 Thread Peter Morgan
Am a bit of a newbie.. but getting an unexpected error... when 
set_active() called and it doesnt select one of the dropdowns


GtkWarning: gtk_entry_set_text: assertion `text != NULL' failed
combo.set_active(1)




  ##colTypes
  selectMe = 'int(11)'
  self.colTypesStore = gtk.ListStore(str)
  self.colTypesStore.append( ['varchar(20)'])
  self.colTypesStore.append( ['int(11)'])
  self.colTypesStore.append( ['timestamp'])  
combo = self.wTree.get_widget('editColTypes'); # combo = gtkComboBox 
from Glade

  combo.clear()
  combo.set_model(self.colTypesStore)
  print len(self.colTypesStore)
  cell = gtk.CellRendererText()
  combo.pack_start(cell, True)
  combo.add_attribute(cell, 'text', 0)
  combo.set_active(1)
  #combo.set_active_iter(1,)
  #combo.set_value_in_list(selectMe, True)
  #combo.set_active_iter(1)

Can anyone shed some light on what I'm doing wrong

Pedro
___
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] Need help with Tree/List view

2006-06-10 Thread David M. Cook
On Fri, Jun 09, 2006 at 03:31:49PM -0400, Hussein Vastani wrote:

> Now my question is. How do I indicate to the user which cell in the row is 
> editable. If he/she has selected a particular row, then there is no clear 

This seems to be a problem with a lot of themes that use a really thin, hard
to see focus indicator.  The only way I know how to fix it is to modify the
style to give a thicker more visible focus indicator.  Take a look at the
gtkrc for the LargePrint theme.  You can change this just for the TreeView
widgets in your app.

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