473,671 Members | 2,229 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 7424
>>>>> "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
6612
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
5662
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
11066
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
1586
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
3863
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
5815
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
34361
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
1846
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
8476
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8598
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
7437
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
6229
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
4225
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4407
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1809
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.