By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,547 Members | 1,425 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,547 IT Pros & Developers. It's quick & easy.

Gtk / pyGtk: How to remove the close button at the top right corner of the dialog window?

P: n/a
ahk
As subject. TIA.
Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
>>>>> "ahk" == ahk <ah*@writeme.com> writes:

ahk> As subject. TIA. --
ahk> http://mail.python.org/mailman/listinfo/python-list
You can override the functionality of that button by connecting your
window or dialog to the delete event. Eg, if you want to hide the
window (but not close/destroy it), you can do

def hide(*args):
window.hide()
return gtk.TRUE
window.connect('delete_event', hide)
Or you can force your window to simply ignore users clicking on that
button by doing

def ignore(*args): # do nothing
return gtk.TRUE
window.connect('delete_event', ignore)

See http://www.async.com.br/faq/pygtk/in...=faq10.006.htp

JDH

Jul 18 '05 #2

P: n/a
ahk wrote:
As subject. TIA.


As far as I know this is controlled by the window
manager.

ie. in "icewm" you can change your preference file
to include / exclude any of the buttons in the title
bar that you want to.

I'm guessing you want to do this because of the
state that's left in your program if someone
closes it using the "X" instead of a close button?

I don't know about pyGtk but in PyQt you have
a "Close Event" signal that allows you to process
what ever you want when a user closes a window, how ever
the window is closed. PyQt also has a signal that's
emmitted from the main app window called "aboutToQuit"
which will close all open windows, thus processing your
close events for each window.

This would be the type of thing to look for in pyGtk.

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.