[Glade-users] glade and motion_notify_event



To make this a little more specific, I created a simple glade
application that solely consists of a GtkWindow which has expose_event
and motion_notify_event handlers.  I am having a similar problem: the
expose event handler is called but the motion_notify_event handler is
not.

Is there a problem that anyone can see in the glade file or the python
file?

--- glade file ---

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>

<glade-interface>

<widget class="GtkWindow" id="window1">
  <property name="visible">True</property>
  <property name="title" translatable="yes">window1</property>
  <property name="type">GTK_WINDOW_TOPLEVEL</property>
  <property name="window_position">GTK_WIN_POS_NONE</property>
  <property name="modal">False</property>
  <property name="resizable">True</property>
  <property name="destroy_with_parent">False</property>
  <signal name="motion_notify_event" handler="on_window1_motion_notify_event" last_modification_time="Tue, 11 
Feb 2003 18:22:31 GMT"/>
  <signal name="expose_event" handler="on_window1_expose_event" last_modification_time="Tue, 11 Feb 2003 
18:23:51 GMT"/>

  <child>
    <placeholder/>
  </child>
</widget>

</glade-interface>


--- python file ---

import gtk
import gtk.glade


class MainWindow:
    def __init__(self):
        self.widgets = gtk.glade.XML('project1.glade')

        self.widgets.signal_autoconnect(
            {'on_window1_motion_notify_event' : self.on_window1_motion_notify_event,
             'on_window1_expose_event' : self.on_window1_expose_event}
            )



    def on_window1_motion_notify_event(self, widget, event):
        print 'motion', event.x, event.y
        return gtk.TRUE

    def on_window1_expose_event(self, widget, event):
        print 'expose'
        return gtk.TRUE

m = MainWindow()
gtk.mainloop ()



Thanks,
John Hunter




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]