Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 191219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:19:21+00:00 2026-05-11T16:19:21+00:00

I have a small project that uses libglade and use the following to load

  • 0

I have a small project that uses libglade and use the following to load the xml file:

self.gladefile = "sdm.glade"
self.wTree = gtk.glade.XML(self.gladefile) 
self.window = self.wTree.get_widget("MainWindow")
if (self.window):
    self.window.connect("destroy", gtk.main_quit)
dic = { "on_button1_clicked" : self.button1_clicked, 
        "on_MainWindow_destroy" : gtk.main_quit}
self.wTree.signal_autoconnect(dic)

After converting my project in glade, what structural changes do I need to make?
I’m on Ubuntu 9.04.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:19:22+00:00Added an answer on May 11, 2026 at 4:19 pm

    You need to use gtk.Builder instead. This class can load any number of UI files, so you need to add them manually, either as files or as strings:

    self.uifile = "sdm.ui"
    self.wTree = gtk.Builder()
    self.wTree.add_from_file(self.uifile)
    

    Instead of get_widget, just use get_object on the builder class:

    self.window = self.wTree.get_object("MainWindow")
    if self.window:
        self.window.connect("destroy", gtk.main_quit)
    

    To connect the signals, just use connect_signals, which also takes a dictionary:

    dic = { "on_button1_clicked" : self.button1_clicked, 
        "on_MainWindow_destroy" : gtk.main_quit}
    self.wTree.connect_signals(dic)
    

    It used to be the case (at least in GTK+ 2.12, not sure if it’s still the same) that you could call connect_signals only once, any signals which are not connected during the first invocation will never be connected. This was different in glade, so be careful if you relied on that feature before.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small RIA that I built as a learning/make-my-life-easier project that uses
I have an ASP.NET project that uses XML Serialization for the main operation for
I have a small racing project that uses a MySQL backend. I am trying
I have a small project that I will be working on shortly that collects
I have a small project and I noticed that I have a lot of
I have a small- to medium-size project that I am doing for my software
i'm trying to make a small project that uses multiple forms (dialogs) for different
I am doing a school project regarding a small website that uses php. I
we are currently working on a rails project that uses i18n and we have
I have a project on that uses core data and I had migration implemented

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.