[Gazpacho] problem with 'changed' signal for textview

Jason Pepas cell at ices.utexas.edu
Wed Jul 20 06:44:01 CEST 2005


Hello,

I can't seem to get the 'changed' signal to work with a textview.

I have attached an example which demonstrates the problem.  It produces
the following error:

Traceback (most recent call last):
  File "./edit-bug.py", line 21, in ?
    app = TextEditor()
  File "./edit-bug.py", line 11, in __init__
    Proxy.__init__(self, gladefile="edit-bug.glade")
  File "/usr/lib/python2.4/site-packages/gazpacho/loader/proxy.py", line 19, in __init__
    self._signal_magicconnect()
  File "/usr/lib/python2.4/site-packages/gazpacho/loader/proxy.py", line 32, in _signal_magicconnect
    self._connect_methods('on_', actions)
  File "/usr/lib/python2.4/site-packages/gazpacho/loader/proxy.py", line 48, in _connect_methods
    widget.connect(signal_name, method)
TypeError: unknown signal name

Hopefully this is just a case of user error :)

Thanks,
Jason Pepas
-------------- next part --------------
#!/usr/bin/python

import pygtk
pygtk.require('2.0')
import gtk

from gazpacho.loader.proxy import Proxy

class TextEditor(Proxy):
    def __init__(self):
        Proxy.__init__(self, gladefile="edit-bug.glade")
        self.textview.get_buffer().set_text("foo")

    def on_window__destroy(self, window):
        gtk.main_quit()

    def on_textview__changed(self,widget):
        print "changed"

if __name__ == "__main__":
    app = TextEditor()
    gtk.main()

-------------- next part --------------
<?xml version="1.0" ?>
<glade-interface>
    <widget class="GtkWindow" id="window">
        <property name="visible">True</property>
        <child>
            <widget class="GtkScrolledWindow" id="scrolledwindow">
                <property name="hadjustment">0.000000 0.000000 422.000000 42.200000 379.800000 422.000000</property>
                <property name="vadjustment">0.000000 0.000000 232.000000 23.200000 208.800000 232.000000</property>
                <property name="visible">True</property>
                <child>
                    <widget class="GtkTextView" id="textview">
                        <property name="visible">True</property>
                        <signal name="changed" after="False"/>
                    </widget>
                </child>
            </widget>
        </child>
    </widget>
</glade-interface>


More information about the Gazpacho mailing list