Close Button and other types of buttons

  • Thread starter Thread starter pairofstrings
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around how to create a close button and other types of buttons in a graphical user interface (GUI). Participants explore various aspects of button implementation, including programming considerations, display technology, and the use of libraries or low-level coding techniques.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant asks how to make a screen display a close button on a window and questions if it depends on display technology.
  • Another participant notes that while windows typically have a close 'x' button, programming proper shutdown actions is necessary to avoid leaving the application in a bad state.
  • There is a suggestion to use a graphics package that includes various button types and to program an 'Exit' action that handles clean-up tasks before closing the program.
  • One participant emphasizes the need for details regarding the operating system and programming language to provide effective help.
  • Another participant asks how to place a button in the top right corner without using any library and requests a description of the hardware mechanism with pseudocode.
  • A follow-up response advises caution against using low-level code that requires consideration of specific monitor hardware, suggesting that working with memory buffers can simplify the process.

Areas of Agreement / Disagreement

Participants express differing views on the necessity of using libraries versus low-level coding for button implementation. There is no consensus on the best approach, and the discussion remains unresolved regarding the optimal method for creating buttons.

Contextual Notes

Participants mention the importance of specifying the programming environment, including the operating system and GUI package, which may influence the implementation details. There are also concerns about the implications of using low-level code versus higher-level graphics utilities.

pairofstrings
Messages
411
Reaction score
7
TL;DR
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   Reactions: Greg Bernhardt

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
1
Views
6K
Replies
11
Views
3K
  • · Replies 14 ·
Replies
14
Views
6K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
5
Views
3K
Replies
9
Views
3K
  • · Replies 45 ·
2
Replies
45
Views
6K