1
\$\begingroup\$

I want to create a custom titlebar/border for my display/window so I set the corresponding system property to "true" but how do I send a close request to the window manually to react to the Display.isCloseRequested()?

\$\endgroup\$
1
\$\begingroup\$

Listen to a preferred event and then do System.exit(0); Then you are good to go! Bear in mind , LWJGL is a OpenGL wrapper , it doesnt include any widgets physics engines and stuff. So make your own button and listen for an event

\$\endgroup\$
  • \$\begingroup\$ Well it does feature the creation of a window for you that has a close requested flag - somehow I need to be able to set this flag ... right? \$\endgroup\$ – salbeira Nov 3 '13 at 19:02
  • \$\begingroup\$ the Display.isCloseRequested() is false till the program gets a request (System.exit(0)) to close the window \$\endgroup\$ – ntakouris Nov 4 '13 at 12:29
  • \$\begingroup\$ Ah - the reason this works is because of the registered shutdown hook that gets created when the window is created - (I did a bit of source digging here ...) \$\endgroup\$ – salbeira Nov 5 '13 at 7:50
  • \$\begingroup\$ Sometimes on Apple systems , you need to call System.exit(0); after Display.destroy(). You just have to. \$\endgroup\$ – ntakouris Nov 7 '13 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.