PyGtk and multiple windows

Nemesis Nemesis at
Sat Jan 25 16:36:16 CET 2003

Hi all,
  I'm learning Python writing a little application (a newsreader).
The interface is designed with Glade, and it is imported in the python
app with the function GladeXML from LibGlade.
The interface has two windows, one of them (I'll call it window2) is in
the hide status (I set the proper switch with Glade), so when it has
to be visible I call a function that does I've linked
the method on_window2_destroy() to the signal destroy related to the
widget window2, this method simply hide window2 and returns 1 (this
should prevent destruction of window2).
But there is a problem, when I show the first time window2 it works
fine, but if I close it and try to reopen I get this error:

Gtk-CRITICAL **: file gtkstyle.c: line 513 (gtk_style_attach): assertion
`style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 1134 (gtk_style_set_background):
assertion `style != NULL' failed.

Gtk-CRITICAL **: file gtkstyle.c: line 3613 (gtk_paint_flat_box):
assertion `style != NULL' failed.

And I get a little black window without any widget in it.

Where is the problem?

I've tested the application with the software that can be found
in Debian Woody:

Python  2.1.3
Gtk     1.2.10
PyGtk   0.6.9
PyGlade 0.6.9
Glade   0.6.4

This is the code:

# This is the callback that activates window2

def on_lista_gruppi1_activate (obj):
    "Mostra la finestra con la lista dei gruppi."
    print "lista gruppi1 activate"

# This is the callback linked to the destroy signal

def on_window2_destroy(obj):
    "Metodo richiamato alla distruzione della window2"
    print "win2 destroy"
    return 1

# This is the function that loads the interface 
interface = GladeXML ("")

# Connecting the signals
dic ={"on_lista_gruppi1_activate":on_lista_gruppi1_activate,


The complete program can be found at :

P.S. Please forgive my poor english ;-)
 |\ |       <->
 | \|emesis <->      "War, war never change us..."

More information about the Python-list mailing list