Re: [pygtk] GtkTreeItem boggle

1999-10-09 Thread Hrvoje Niksic

James Henstridge [EMAIL PROTECTED] writes:

 Now in order to have the same python object refer to a particular
 gtk object all the time, the gtk object would need to hold a
 reference to it (we don't want the python object to be freed while
 the gtk object is in use).  This forms a circular dependency,

It doesn't, since the Python collector knows nothing about Gtk
objects.
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



Re: [pygtk] GtkTreeItem boggle

1999-10-09 Thread James Henstridge

The problem is that the python object holds a reference to the GtkObject
through a call to gtk_object_ref.  This reference will be decremented with
gtk_object_unref when the python object is destroyed.  If the GtkObject
also held a reference (using Py_INCREF), then we would have a circular
dependency.

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/


On 9 Oct 1999, Hrvoje Niksic wrote:

 James Henstridge [EMAIL PROTECTED] writes:
 
  Now in order to have the same python object refer to a particular
  gtk object all the time, the gtk object would need to hold a
  reference to it (we don't want the python object to be freed while
  the gtk object is in use).  This forms a circular dependency,
 
 It doesn't, since the Python collector knows nothing about Gtk
 objects.
 To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
 

To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]



[pygtk] GtkTreeItem boggle

1999-10-08 Thread Jozsa Kristof

Hello,

   I'm new on the list so a short introduction goes here: I'm a newbie both
in python and pygtk (means a few week experiences - I guess that counts as
newbie ;), but programmed on several other languages including C/C++, Java,
PHP3 and a bit Perl. I'm also studying IT in Hungary. /oh well, and sorry
for my bad English sometimes/

   I've got confused around GtkList and GtkListItem-s 2 days before and
seems I cannot figure out what I'm doing wrong. I've defined a GtkList and
put it out to my GUI. I've filled it with a couple of GtkListItems, and
stored the references for myself for future use. Later, when I query which
item of the list is selected, I get an instance of a GtkListItem, which does
not match with any of the stored instances. 

"""See the code if that's not clear:
self.dlbox = dlbox = GtkList()
self.inbox = list_item = GtkListItem("INBOX")
dlbox.add(list_item)
list_item.show()

# later, after selecting the item INBOX from the list visually
selected = self.dlbox.get_selection()
selected[0] == self.inbox  # that's false

The two instances when I print out refer to different memory addresses,
and (no surprise after that), there's no such instance in my stored
instances what's get_selection() returns. 

I guess I'm doing some trivial stupidity, but cant see what's it :(
Can anyone help please?

Christopher

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-: .~. :-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ 
| Christopher Jozsa   /V\Veszprem Linux Users Group |
| [EMAIL PROTECTED] /( )\   student of IT, Hungary |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=--: ^^-^^ :--=-=-=-=-=-=-=-=-=-=-=-=-=-+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]