[pygtk] refs and reparent ...

2000-07-17 Thread MOULET Xavier FTRD/DMR/ISS

I have a problem with pygtk (great works which gets more and more attention
!)(which it deserves)

i have two treeitems in a tree.
I connect those iteme to signal select, unselect, get_target_getdata and
drag_source_givedata, and declare them as drag_source and drag_target (i
don't remember the signals but the idea is here). 

i would like to go from : 
-A
-B

to 

-A
 + B.

originally, they display and drags right, but when i try to reparent the
second item to a subtree of the first item, or try to do
itemB["parent"].remove(item),(to create a new B as a subtree of A) then the
application segfaults.

From C gtk programs' sources, people usually ref() the object and then
reparent it. 

I haven't seen any ref() method to gtkobject (and i assume this is right as
python takes care of ref counting), but if i try to disconnect all signals
and try to unset dragsources  all, this doen't work either.

I'll try to have a simple program that segfaults unconditionnally to be more
explicit.

I have gtk 1.2.8 and pygtk 0.6.6

Are this kind of problem known issues, resolved with the extensionclass way
in 0.7 ?

thanks in advance for any useful input, I'll try to be more explicit, but
this really drives me crazy !

xavier

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] python, libglade, GtkXmHTML

2000-07-17 Thread Martijn Faassen

James Henstridge wrote:
 On Mon, 17 Jul 2000, Martijn Faassen wrote:
[snip]
* do a manual .add() of a GtkXmHTML instance to a widget in my 
  libglade built window.
  
  This doesn't seem to do anything. Can't even add buttons or labels
  this way. Is this due to the use of libglade? It seemed to work in
  PyGTK proper.
 
 This should work.  If you have some container widget in the glade file you
 should be able to add a GtkXmHTML widget.  You did show() the XmHTML
 widget, didn't you?

Ah, show() was the magic method that makes it all work. Thanks! I 
didn't run into this in the many documents I perused last night
for some reason..must've been looking in the wrong places. 

Given my one day experience with GTK programming I hope you'll forgive
my ignorance. :) It speaks for PyGTK, Glade, libglade and python that I was
already trying to integrate a HTML widget after a day. 

Thanks again, also for the quick response!

Regards,

Martijn


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] PyGTK and urllib

2000-07-17 Thread Martijn Faassen

Hi there,

I've run into an odd problem with urllib.urlopen() apparently taking a *lot*
more time when used through PyGTK (using LibGlade and Gnome) than when
I call the same routine through python only. In fact, if I call 
urlopen() through the Gnome interface, *everything* in X seems to become
unresponsive; the only thing I can move around is the mouse cursor, but
since I can't click anything, it's not very useful.

Oddly enough in the same app I call urlopen() somewhere else that doesn't
cause this kind of blocking. But I did whittle down my code and it *does*
seem to be urlopen() in the second case.

Anyone have any suggestions?

Regards,

Martijn


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] PyGTK and urllib

2000-07-17 Thread James Henstridge

On Mon, 17 Jul 2000, Martijn Faassen wrote:

 Hi there,
 
 I've run into an odd problem with urllib.urlopen() apparently taking a *lot*
 more time when used through PyGTK (using LibGlade and Gnome) than when
 I call the same routine through python only. In fact, if I call 
 urlopen() through the Gnome interface, *everything* in X seems to become
 unresponsive; the only thing I can move around is the mouse cursor, but
 since I can't click anything, it's not very useful.
 
 Oddly enough in the same app I call urlopen() somewhere else that doesn't
 cause this kind of blocking. But I did whittle down my code and it *does*
 seem to be urlopen() in the second case.
 
 Anyone have any suggestions?

Unless I am mistaken, urllib is a syncronous interface, so it will not
return until it has completed the transfer.  This means your application
will not process any events (mouse clicks, expose events, etc) until the
transfer completes, which is what is causing your problems.

You should either use an asyncronous transfer (using the
input_add() function to set up a handler for when information comes in on
the socket), or look at using threads.

 
 Regards,
 
 Martijn
 

James.

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



___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk