Web lists-archives.com

Migration from glade to gtkbuilder




Hello all,

     I have a project built on glade, gtk+ 2.6 and pygtk. My intention is to update it to more recent version in order to manage changes. I also would like to use gtkbuilder instead on libglade to remove dependency from this: http://kefir.sourceforge.net/tepache/SimpleGladeApp.html.

     I have executed the following:

  1. migrated project.glade UI to project.ui with gtk-builder-convert. Fixed duplicated id-s.  It went OK
  2. changed all gtkdialog window types to "popup". Only main window has attribute window type = "Top Level"
  3. created separate helper.py file to describe Handler signals
  4. here is my main window initialization part:
    def run(self):
    builder = gtk.Builder()
    builder.add_from_file("project.ui")
    builder.connect_signals(Handler())
    wMain = builder.get_object("wMain")
    wMain.show_all()
    gtk.main()
  5. This runs, but side effects are the following:
  • Main window is opened, but also some dialogs are opened as well. Aside from main window.
  • Main window does not react on "close" button. It seems signals are not handled. Here is my Handler:
    class Handler:
    def on_wMain_destroy(self, *args):
    gtk.main_quit(*args)

    def on_wMain_delete_event(self, *args):
    gtk.main_quit(*args)

    May be I am doing something completely wrong. I am new to GTK+ development and these simple task fail scare me a bit.

Thank you for help,

Vadim. 

 

 
_______________________________________________
gtk-devel-list mailing list
gtk-devel-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-devel-list