Close Button and other types of buttons

  • Thread starter Thread starter pairofstrings
  • Start date Start date
AI Thread Summary
Creating a close button for a window involves programming considerations that depend on the operating system and the graphics library used. A standard approach includes utilizing a graphics package that offers user interface components like buttons and input fields. This allows for programming a button with an 'Exit' action that can execute necessary clean-up tasks before closing the application, such as saving data or confirming closure with the user.The discussion emphasizes the importance of specifying the programming language and operating system to receive tailored assistance. While the placement of a button in the top right corner can be conceptualized, it is advised to avoid low-level coding that directly interacts with hardware specifics. Instead, using higher-level graphics utilities simplifies the process and minimizes potential issues. The conversation highlights the need for clarity in the coding level and the benefits of using double-buffering techniques to manage display updates effectively.
pairofstrings
Messages
411
Reaction score
7
TL;DR Summary
How to build buttons?
Hi.
Thanks for taking my question.
How to make screen display close button on a window?
Does it depend on display technology?
 
Technology news on Phys.org
Any window will have the little 'x' in the upper right corner, but unless you program some shut-down actions, it might leave things in a bad state.

You should use a graphics package that provides general utilities like toggle buttons, radio buttons, text placement, user typed input fields, etc. Then you can program a button as an 'Exit' action and have it trigger any clean-up actions before the program is killed. It should do things like close files, complete any pending operations, ask the user if he is sure he wants to close the program or save results, etc. Unfortunately, I am not up to date on the current graphics user interface packages for different operating systems.

You should specify what operating system and language you are working with if you want good help. If you are programming with Python, you might be interested in this.
 
pairofstrings said:
TL;DR Summary: How to build buttons?

Hi.
Thanks for taking my question.
How to make screen display close button on a window?
Does it depend on display technology?
Short on details.

Are you making a graphical program?
what operating system are you using, what GUI package for what language?
It shouldn't depend upon the display technology per se.
 
How to put a button on the top right corner without using any library? Can you describe hardware (display technology) mechanism with little pseudocode that puts a button right up there?
 
pairofstrings said:
How to put a button on the top right corner without using any library? Can you describe hardware (display technology) mechanism with little pseudocode that puts a button right up there?
You should probably be more specific about what level of code you are talking about. IMO, you should be careful not to use such low level code that you have to worry about the details of the specific monitor hardware. If you deal with the buffer in memory, that avoids a lot of hardware considerations. I recommend that you use a double-buffer option or strange things can happen in different situations. I have only dealt with relatively high level graphics utility software. Even the high level utilities should have the capability of drawing individual line segments. Working at that level would be more tedious.
 
  • Like
Likes Greg Bernhardt
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
Back
Top