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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:49:09+00:00 2026-06-18T04:49:09+00:00

I have a GUI designed in glade , using python/gtk in the background.I want

  • 0

I have a GUI designed in glade, using python/gtk in the background.I want to handle the delete event and display a “Are you sure?”-message dialog.I have been trying to handle the delete and destroy events, but failing to do so.any light?

#!/usr/bin/python
import .... stuff




class App:
  def __init__(self):


    self.gladefile = 'test.glade'
    windowname = 'window'# This must match the window name in glade
    self.wTree = gtk.glade.XML(self.gladefile, windowname)# object for acessing widgets


    dic={
    # Also need to set project2's signal tab
       'on_window_delete_event':self.on_erro,
       'on_window_destroy_event':self.on_erro,
         }

    self.wTree.signal_autoconnect (dic)
    self.op=self.wTree.get_widget('window')
    self.op.show()

  def on_erro(self,widget,*args):

        print 'hello'






app = App()
gtk.main()

This code opens a simple window .On clicking on close button, it prints hello and exits.(I want the window to remain open)

  • 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-18T04:49:10+00:00Added an answer on June 18, 2026 at 4:49 am

    You have to return True in order to stop propagation of the delete event in the callback on_erro as mentioned in the documentation for "delete-event". In your current code, the callback is not returning any boolean value as required by the function, which I am guessing is returning False (Please check the signature for on_window_delete_event callback functions, the return type is boolean)
    Hope this helps!

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

Sidebar

Related Questions

I am new new to GWT. I have designed the Gui using GWT designer.
I have designed a GUI connect to DB button using Swing in java now
So i have a gui, designed using QT, c++. I have large amount of
I have designed the following GUI in which there are an axes. I want
i have a question: I designed my GUI without the InterfaceBuilder, now i want
I have designed a file copy software in python with GUI in Wxpython .
I have designed a GUI with uitabs. I want to achieve a smooth transition
I have designed this gui in netBeans which has a canvas , a couple
I have a GUI app that is getting to be quite slow. I want
I have designed a GUI which has an uitable and a push button which,

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.