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 8240309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:26:52+00:00 2026-06-07T20:26:52+00:00

I am designing a small GUI to interface with a piece of code I

  • 0

I am designing a small GUI to interface with a piece of code I have written.

My problem is that the Gtk.main() command seem to be blocking, and even though my window closes when I click the destroy button, my terminal is still hanged.

I also do not see any interaction with signals.

Here is my sample:

#!/usr/bin/env python

from gi.repository import Gtk, Gdk, GObject

GObject.threads_init()

class Ivolution():       

    def __init__(self):

        print "in"
        self.builder = Gtk.Builder()
        self.builder.add_from_file("data/ui/IvolutionWindow.glade")
        #builder.connect_signals({ "on_window_destroy" : gtk.main_quit })
        self.window = self.builder.get_object("ivolution_window")
        print "in fin"

    def on_stopbutton_clicked(self, widget):
        """
        Asks the Facemovie thread to terminate
        """
        print "Stop"    

    def on_ivolutionwindow_destroy(self, widget, data=None):
        """Called when the IvolutionWindow is closed."""

        # Clean up code for saving application state should be added here.
        print "Exiting"
        Gtk.main_quit()
        print "Exited"

if __name__ == "__main__":
    app = Ivolution()
    print "deb"
    app.window.show()
    Gdk.threads_init()
    Gdk.threads_enter()
    print "but"
    Gtk.main()
    print "end"
    Gdk.thread_leave()
    print "ding"

I removed all the non essential parts.

The Gobject and gdk.threads things are tests I have made looking at different source codes over the internet.

I couldn’t come up with a successful combination of them.

If I run the program into a console, here is what I get:

in

(Ivolution.py:4635): Gtk-CRITICAL **: gtk_radio_button_set_group: assertion `!g_slist_find (group, radio_button)' failed

(Ivolution.py:4635): Gtk-CRITICAL **: gtk_radio_button_set_group: assertion `!g_slist_find (group, radio_button)' failed
in fin
deb
but

Even though I hit the stop button and closes the window.

Once I close my window, the console stays the same, and even a ctrl+c won’t stop the application.

I am sure I miss something basic, but as a complete GUI noob I don’t see what. This sample code seem really close to mine. Any idea?

  • 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-06-07T20:26:54+00:00Added an answer on June 7, 2026 at 8:26 pm

    Ok, I feel both angry and a fool at the same time here.

    I try to reuse code from an attempt I made with Quickly

    I had no signals defined in my glade file.
    For some reason I don’t exactly get, Quickly lets you call events without defining them in the glade files.

    sure it couldn’t work.

    Th Python code above works fine, provided that you have the correct signals defined in your glade file

    EDIT :

    As a complement of information, here is how a signal would look like in the glade file

    <signal name="delete-event" handler="on_destroy" swapped="no"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small database that I need help designing. I have a VB.NET
I am designing a Point-Of-Sale system for a small shop. The shop just have
I'm currently designing a small application in which I have: - 1 menu (graphic
I am designing a small webpage targeted for the iPhone/iPod touch. I have a
I've just finished designing a small android app and have now come to a
I am designing a small website that I want to be able to browse
A small but important corner of a database that I'm designing will be used
I'm currently using JScript.NET for a small UI application. The problem is that my
I'm designing an application that will use Oracle , and we have this department
When designing a C API for configuring a library/utility, I have a co-worker who

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.