473,700 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

ahk
As subject. TIA.
Jul 18 '05 #1
2 7438
>>>>> "ahk" == ahk <ah*@writeme.co m> 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
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 "aboutToQui t"
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6621
by: Nick Atkins | last post by:
Hi all, I am writing an application using pyGTK that has several pop-up dialogs that show and hide in succession. I would like to prevent the user from closing the dialog and if possible I'd like to use a "title bar-less" window with a normal border so the X is not even available to click. Is this possible? I have tried using window.set_decorated(FALSE) but this also removes the border making the window look quite strange.
4
5664
by: Colin Graham | last post by:
Hi guys, Just a quickie here that i hope someone can help me with. Basically i want stop the user from closing the popup window using the small x button in the top right hand corner. Im aware that i cant disable this so i thought is it possible to do a check to see if a hidden text on the main form has a value. E.g. if we close the popup correctly then text box on the main form will say true. If we close the text box using the x in the...
8
2221
by: william | last post by:
Hi All, I have a question about closing a dialog box. The thing is: I have two ASP.NET pages. From one page, I open another page as window.showModalDialog. THere is a button on the second page. On the click event of the button on second page, I put code "Response.Write("<script language='javascript'> { self.close();}</script>")" or "Response.Write("<script language='javascript'> { window.close();}</script>")". But it doesn't work. WHen I...
5
11068
by: Stan Sainte-Rose | last post by:
Hi, Which event is called when the user click on the close window icon (X) ? I want, when he clicks on this icon, to display a message before closing the form. If he replys by No, I don't want to close the form. Thks for your help Stan
0
1592
by: kingcrowbar.list | last post by:
Hello Everyone I have been playing a little with pyGTK and threading to come up with simple alert dialog which plays a sound in the background. The need for threading came when in the first version i made, the gui would freeze after clicking the close button until pygame finished playing the sound. In Windows it was acceptable because it could be ignored easily, but in
1
3865
by: dan.c.roth | last post by:
oForm.Close() vs this.Close() in a modal dialog. oFrom.Close() calls Form.Dispose() but this.Close() ,say in the click event of the Form, does not. I can think of the reason for this but is this documented and if so can someone give me the reference. And is this true for .net 1 and 2. Thanks
7
5824
by: Toccoa | last post by:
After considerable googling - I mean searching with Google(r) - I could not find javascript on a button or <a href=... to close a window in the latest versions of IE and FireFox. There seemed to be two techniques for earlier versions. But the window.opener='' ;window.close(); and the window.open('','_parent','') ;window.close(); techniques do not work for me. I.e., I still get confirmation message
5
34363
by: jimmy | last post by:
Hi all, I want to capture the event when the browser's close button is clicked in an html page. I tried using the event.ClientX and event.ClientY property in the body unload event, and this helps to recognise whether the close button is clicked( also differentiates whethet refresh was clicked). The problem arises whenever i try to close the window by resizing it or by right clicking at the bottom of the page and then closing it. Can...
5
1847
by: solar | last post by:
How can I remove the three buttons on the upper right corner in the database ? These three buttons are called "minimize" "restoredown"and "close". With the command Application.CommandBars("Menu bar").Enabled = False With the help of the above command remove all the buttons and the screen is clear of them, but these three buttons remain on the right upper corner. Is there any command with which to remove them by code ? In the design...
0
9217
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8926
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6563
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4659
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3092
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.