Re: [pygtk] pyORBit and threading

2003-11-11 Thread James Henstridge
On 30/10/2003 1:02 AM, Sebastian Rittau wrote:

Hi!

I'm trying to get pyORBit to work with threading. Unfortunately this
does not seem to work. When starting the attached sample script, the
script will print out numbers of up to ~100 and then stop. gdb reports
that thread 1 is hanging in poll(), while thread 3 is waiting for a
signal. Has anybody any ideas on how to proceed to track this problem
down?
 

Currently PyORBit doesn't support multithreading.  In order to do this 
right, I would probably need to use the PyGILState_* functions from 
Python 2.3, and possibly require ORBit 2.8 which supports multi-threaded 
POAs (ie. allowing requests to be handled by other threads, rather than 
blocking or causing unexpected reentrancy)..

James.

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


___
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] right-justified text in Entry widget?

2003-11-11 Thread Hans-Joachim Widmaier
Hi,

I've tried vainly to come up with something that gives me an Entry widget where the 
text inside is right-justified.  entry.get_layout().set_alignment(pango.ALIGN_RIGHT) 
did not work.  A .context_changed() thereafter doesn't help, too.

Either nobody but me wants this feature, or I'm missing something very obvious, as 
nobody seems to have asked this before (searched with Google and the mailing list 
archives).

Any help would be greatly appreciated!

-- 
Hans-Joachim
__
WEB.DE FreeMail wird 5 Jahre jung! Feiern Sie mit uns und
nutzen Sie die neuen Funktionen http://f.web.de/features/?mc=021130

___
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

2003-11-11 Thread David Bernard
http://www.moeraki.com/pygtktutorial/pygtk2tutorial/index.html

Pablo Grigoletti wrote:

Anybody can send me a source code of PyGTK ...
can be a easy one, but not a HELLO WORLD :P!
Tkz

Pablo

 

___
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/C extension - segfault

2003-11-11 Thread Tomas Bouda
 Hi,
a few days ago, I've got a great help on gtk<->pygtk objects wrapping. 
Thanks a lot. 

Now, I have the library but the application crashes on segfault. I've been 
thinking it is problem of mine or problem of Python but PyGtk seems to have 
own part of this too. 

My program looks like: 

/* python setup */
...
Py_Initialize();
... 

/* module setup */
initcavfs(); // init C extension - module cavfs
initpywrap(); // init C extension - module pywrap 

/* While cavfs does just Py_InitModule("cavfs", cavfs_methods); */ 

Now, on init_gobject() or "import gtk" I get a segfault which ALWAYS leads 
to a stack trace similar to: 

#0  0x4d8b07f3 in strrchr () from /lib/libc.so.6
#1  in cavfs_methods()
#2  in init_gobject()
loading /usr/lib/python2.2/site-packages/gtk-2.0/libgobject.so
... 

Please, note that cavfs_methods is a variable of type PyMethodDef. There's 
no such method and it isn't referenced elsewhere! Compiled library contains 
cavfs_methods pointer in a data part not code part. 

Does anyone faced the same problem? Or can you image where's the root of my 
problem? Why does cavfs_methods get called? 

 Thanks a lot, Tobbi 

___
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] My menubar disappear with mysql

2003-11-11 Thread mc collilieux
Le Fri, 7 Nov 2003 09:42:32 +1300
David Moore <[EMAIL PROTECTED]> écrivait : 


> I just store a reference as a member variable.  e.g.
> 
>  self.item_factory = gtk.ItemFactory(gtk.MenuBar, "",
>  accel_group)
> 
> Storing it where I could retrieve it later prevents the garbage
> collector from tidying it up.  A global variable would work to, but of
> course "global vars are bad".

I have manage to get reference for ItemFactory, thanks. 
With this or change menu I have choice now.

-- 
Marie-Claude Collilieux
Bretagne 
___
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] how to add item to combo.list

2003-11-11 Thread Harobed
Hello,

I would like append one element to combo.list

this code don't work :

combo=gtk.Combo()

combo.list.append("foo") <-- error

I don't want use set_popdown_strings, I would direct access to list.

Thanks
Stéphane KLEIN

___
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] My menubar disappear with mysql

2003-11-11 Thread mc collilieux
Le Tue, 4 Nov 2003 12:15:12 +1300
David Moore <[EMAIL PROTECTED]> écrivait : 

> Hi,
> 
> Are you using an ItemFactory?  Do you keep a reference to it?

Thanks for your reply

Yes, I use ItemFactory, I have only imitate the example in the
pygtk-tutorial. What do you mean
by "keep a reference" ? How can I do that ? 

Your idea is good, I have replace ItemFactory by 'hard' method and my
menubar is always visible
Ouf, an impossible problem has a answer (of course !) but I can't more
understand the link between ItemFactory and MySQLdb !
Thanks very much
Who said amways at the end of the clip "I am happy" ?

-- 
Marie-Claude Collilieux
Bretagne 
___
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] pyORBit and threading

2003-11-11 Thread Sebastian Rittau
Hi!

I'm trying to get pyORBit to work with threading. Unfortunately this
does not seem to work. When starting the attached sample script, the
script will print out numbers of up to ~100 and then stop. gdb reports
that thread 1 is hanging in poll(), while thread 3 is waiting for a
signal. Has anybody any ideas on how to proceed to track this problem
down?

 - Sebastian
#!/usr/bin/python

import threading
import time

import CORBA

def run():
i = 0
while True:
print i
time.sleep(0.01)
i += 1

if __name__ == "__main__":
orb = CORBA.ORB_init()

t = threading.Thread(target = run)
t.start()

time.sleep(1)

orb.run()
___
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] button causes pop-up menu (?)

2003-11-11 Thread Joey Tsai
Hello,

I've been hitting my head for quite some time now on how to make a button cause
a menu appear.  At least, that's what I think I want.

What I actually is something like evolution's contact editor, where entering
someone's birthday actually just consists of pushing a button, which causes a
calendar widget to appear under it.  I've gotten as far as having the menu item
display a menu with the calendar in it, but since I think the menu doesn't
expect the calendar widget it's useless.  Plus, it's "selected" by the menu,
which just makes it look ugly.

I hope this description isn't too confusing.  Any help would be appreciated. 

Please CC to me.  I can provide code snippets or whatever's useful.


-- 
   |  "You shall have joy or you shall have power," said God.  "You
 joey tsai |  shall not have both."
   |-- Ralph Waldo Emerson
___
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

2003-11-11 Thread Pablo Grigoletti
Anybody can send me a source code of PyGTK ...
can be a easy one, but not a HELLO WORLD :P!

Tkz

Pablo

-- 
[ PABLO SOUZA GRIGOLETTI ]
[ [EMAIL PROTECTED] - [EMAIL PROTECTED] ]
[ http://atlas.ucpel.tche.br/~pablogri ] 
[ UIN #117498521 - GNU\Linux User #121890 ]

[ "NAO PODEMO SE ENTREGA PROS HOME, MAS DE JEITO NENHUM ..." ]
___
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] applet signal

2003-11-11 Thread ddt
Hello,
when gnome-panel died what signal send to child applets?
applet connect "delete-event" and run "killall gnome-panel" raise error
and hang.
this is error messages.
(gdick:4899): Gdk-WARNING **: GdkWindow 0x1e0007b unexpectedly destroyed
 
(gdick:4899): Gdk-WARNING **: GdkWindow 0x1e0007a unexpectedly destroyed
 
(gdick:4899): Gdk-WARNING **: GdkWindow 0x1e00078 unexpectedly destroyed
 
(gdick:4899): Gdk-WARNING **: GdkWindow 0x1e00077 unexpectedly destroyed
 
(gdick:4899): Gdk-WARNING **: GdkWindow 0x1e00075 unexpectedly destroyed


___
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] Distributing with py2exe -correct question

2003-11-11 Thread Christian Robottom Reis
On Tue, Nov 11, 2003 at 05:28:44PM -0300, Ivan Hernandez wrote:
> Sorry for the previous post, i pushed send by error.
> 
> >Hello. I have tried py2exe to distribute my PyGTK2 script. I'm using 
> >win2k and python 2.3.2 and pygtk2.0 
> 
> the problem is that it says that it can't found the gdk module while 
> making the dist.

Looked at the FAQ yet?

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331
___
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] Distributing with py2exe -correct question

2003-11-11 Thread Ivan Hernandez
Sorry for the previous post, i pushed send by error.

Hello. I have tried py2exe to distribute my PyGTK2 script. I'm using 
win2k and python 2.3.2 and pygtk2.0 
the problem is that it says that it can't found the gdk module while 
making the dist.

some help?

___
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] Distributing with py2exe

2003-11-11 Thread Ivan Hernandez
Hello. I have tried py2exe to distribute my PyGTK2 script. I'm using 
win2k and python 2.3.2 and pygtk2.0
some help?

___
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/C extension - segfault

2003-11-11 Thread Tobbi
   Hi all,

problem finally solved, see bellow.


- Original Message - 
From: "Tobbi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 11, 2003 11:48 AM
Subject: Re: [pygtk] PyGtk/C extension - segfault


>Hi James,
>
> >
> > You didn't compile your cavfs module with debug info (or alternatively,
> > you passed -export-symbols-regex to an unpatched libtool when linking
> > your module).  When this happens, gdb makes its best guess about what
> > function the stack frame refers to based on what it finds in the dynamic
> > symbol table.  This often causes static functions to be mistaken for
> > visible symbols defined near by.
> >
> > Without the debug info, it is a lot more difficult to diagnose the
> problem.
> >
>
> I didn't, that's true, but my backtrace in gdb is complete so I assume
pygtk
> already contains a debug info.
> After sitting many hours on the problem I found it is caused by a
DEFINITION
> of a global variable!
> Strange, huh?
>
> Precisely:
>
> module cavfsmodule.c defines:
> static PyMethodDef cavfs_methods[] = {
> ...
> };
>
> module gwrapper.c defines:
> PyTypeObject *PyGObject_Type = NULL;
>
>
> Now, the segfault occurs, gdb says that cavfs_methods is called although
it
> is referenced just in the initialization method.
> If I change gwrapper.c to: "static PyTypeObject *PyGObject_Type = NULL;"
the
> segfault new happens.
>
> Finally, this seems to be a compilation problem, isn't it?
> Actually, I'm happy I found a way to avoid the problem. If someone has
> similar experience, please, let me know.
>
>

The library gobject.so contains a global variable PyTypeObject
*PyGObject_Type.
This leads to conflict and segfault. I'm not good enough to explain why, but
that's enough for me :)

   Tobbi


___
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/C extension - segfault

2003-11-11 Thread Tobbi
   Hi James,

>
> You didn't compile your cavfs module with debug info (or alternatively,
> you passed -export-symbols-regex to an unpatched libtool when linking
> your module).  When this happens, gdb makes its best guess about what
> function the stack frame refers to based on what it finds in the dynamic
> symbol table.  This often causes static functions to be mistaken for
> visible symbols defined near by.
>
> Without the debug info, it is a lot more difficult to diagnose the
problem.
>

I didn't, that's true, but my backtrace in gdb is complete so I assume pygtk
already contains a debug info.
After sitting many hours on the problem I found it is caused by a DEFINITION
of a global variable!
Strange, huh?

Precisely:

module cavfsmodule.c defines:
static PyMethodDef cavfs_methods[] = {
...
};

module gwrapper.c defines:
PyTypeObject *PyGObject_Type = NULL;


Now, the segfault occurs, gdb says that cavfs_methods is called although it
is referenced just in the initialization method.
If I change gwrapper.c to: "static PyTypeObject *PyGObject_Type = NULL;" the
segfault new happens.

Finally, this seems to be a compilation problem, isn't it?
Actually, I'm happy I found a way to avoid the problem. If someone has
similar experience, please, let me know.

   Thanks, Tobbi


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