1

I start to develop a test application to experiment button clicks, window's title change and other widgets use.

on button objects it's easy to make event "clicked" to work, in to window class and declare on_button_clicked(...) and works, no more its needed.

def on_button1_clicked(self, button):
    print "Clicked Exit"
    Gtk.main_quit()

but whit the Entry object i try to make some similar to the event "changed" whitout success. Do any one have a clue about how to handle events on this an other type of object (Entry, Comoboxtext, Radiobutton, etc) on Python/Quicly

I try some like this but didn't work

def on_entry1_changed(self, entry):
    self.ui.prototipo1_window.set_title(self.ui.entry1.get_text())

Any one? thank you a lot by your help.

1 Answer 1

1

If you are getting started with PyGtk and Quickly, I would definitely recommend this tutorial, it has helped me very much.

Are you using Glade for your gui designer? If you arn't, you would have to connect the signals manually by doing something like this:

from gi.repository import Gtk

class Handlers:
    def on_button1_clicked(self,builder):
        print "Clicked Exit"
        Gtk.main_quit()

    def on_entry1_changed(self,builder):
        entry = self.builder.get_object("entry1")
        self.builder.get_object("TestWindow").set_title(entry.get_text())

builder = Gtk.Builder()
builder.add_from_file("example.ui")
builder.connect_signals(Handlers())
window = builder.get_object("TestWindow")
window.show()
Gtk.main()

More about manually connecting handlers like this is found here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .