Вопрос

Greetings guys and girls!

I am new in programming Gtk+ and need a "decent" opensource twitter client and I can't find one, so I'm developing one that 'll be opensource. I'm using Gtk+3 and Python (PyGObject not PyGtk), and I'm having 2 problems with my Entry: 1 - can't connect a handler to these signals : "deleted-text" and "inserted-text" to an to my tweet_text that is a Entry. I tryied self.tweet_text.connect("inserted-text", self.on_tweet) and self.tweet_text.set_property("inserted-text", self.on_tweet) but it keeps failing. 2 - can't make my tweet_text multine.

I searched the documentation here http://readthedocs.org/docs/python-gtk-3-tutorial/en/latest/ but I can't find nothing related with it. And a also searched the C documentation related to Gtk+3.

I apreciate if someone help. Thanks in advance.

Это было полезно?

Решение

The problem here is that the inserted-text signal is emitted by Gtk.EntryBuffer objects, not by Gtk.Entry ones. To connect to that signal, you should use something like this:

entry = Gtk.Entry()
entry_buffer = entry.get_buffer()
entry_buffer.connect('inserted-text', callback)
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top