Sending signals beween plug and socket

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Sending signals beween plug and socket

andy pugh
I am trying to propagate a signal between a host application that
accepts user-supplied content embedded inside it and the user-supplied

For reference the hosting application embeds the content here:

Using the sub-application here:

I am trying to signal from "Touchy" to "GladeVCP" that its tab has
been _deselected_ (we seem to get a visibility-notify automatically on
selection, but not on deselection)

I have tried using "emit" but I get the error message:
TypeError: could not convert type NoneType to GParam required for parameter 0
with the code below:

def tabselect(self, notebook, b, tab):
   new_tab = notebook.get_nth_page(tab)
   old_tab = notebook.get_nth_page( = tab
   for c in self._dynamic_childs:
      if == 'GtkSocket':
        w = new_tab.get_plug_window()
           if new_tab.get_id() == c:
              print "touchy plug_window xid visible = ", w.xid
              w.emit('notify::visible', gtk.gdk.VISIBILITY_UNOBSCURED)
       if == 'GtkSocket':
         w = old_tab.get_plug_window()
            if old_tab.get_id() == c:
                print "touchy plug_window xid hidden = ", w.xid
                w.emit('notify::visible', gtk.gdk.VISIBILITY_FULLY_OBSCURED)

So it seems that perhaps I need to create a new "GParam", but can't
find any documentation on how to do that.

Another of our developers tried the code below, but also met with no
success: He only appeared to get events in GladeVCP when he resized
the window.

        def tabselect(self, notebook, b, tab):
       = tab
                for c in self._dynamic_childs:
                    if =='GtkSocket':
                        w= new_tab.get_plug_window()
                        if new_tab.get_id()==c:
                                print"touchy plug_window xid visible =", w.xid,w
                                event = gtk.gdk.Event(gtk.gdk.VISIBILITY_NOTIFY)
                                event.window = w
                                event.state = gtk.gdk.VISIBILITY_UNOBSCURED
                                event.send_event = True
                    if =='GtkSocket':
                        w= old_tab.get_plug_window()
                        if old_tab.get_id()==c:
                                print"touchy plug_window xid hidden =", w.xid,w
                                event = gtk.gdk.Event(gtk.gdk.VISIBILITY_NOTIFY)
                                event.window = w
                                event.state = gtk.gdk.VISIBILITY_FULLY_OBSCURED
                                event.send_event = True


I have also tried sending UNIX signals between the programs, but
couldn't make that work either.

In summary, the questions are:

How can I create a new "GParam" to use as an argument to w.emit()?
If I do manage to do that, will it have the results I hope for?

Is there a better way, or any way, to have a gtkSocket cause code to
run in a gtkPlug?

"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
— George Fitch, Atlanta Constitution Newspaper, 1916
pygtk mailing list   [hidden email]
Read the PyGTK FAQ: