Jump to content

Window:Getcurrent():Closed() ¿?


Yue
 Share

Recommended Posts

I have a concern about the command to check if a window is closed. What happens is that after pressing the close button, it always returns true, I would expect it to automatically return false, after being pressed. This has me in trouble with the exit management of the program through a menu where it should show a dialog box that is activated from an exit menu button and the title bar on the close button.

 

 

 

 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

  • 2 weeks later...
On 9/19/2021 at 12:58 AM, Josh said:

while (PeekEvent())

{

auto = WaitEvent();

if (e.id = EVENT_WINDOWCLOSE) Print("CLOSE!");

}

 

One question, that only works in C++, I'm in lua, and I can't find the equivalent for the window close event.

 

while EventQueue:Peek() do
					local event = EventQueue:Wait()
					
					
					if event.id == Event.WindowClose then
		
							System:Print("CLOSE TEST")

....

 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

while EventQueue:Peek() do
					local event = EventQueue:Wait()
					
				
					if event.id == Event.WindowClose then
		
							System:Print("CLOSE TEST")


					elseif event.id == Event.WidgetAction then

						if event.source == self.btnStart then 
							self.Gui:Hide()
							self.button = self.START
						
				
							
						end
						if event.source == self.btnOptions then
							
							self.pnlOptions:Show()
							self.pnlStart:Hide()

						elseif event.source == self.btnExit then 
							self.pnlStart:Hide()
							self.pnlBox:Show()
					

						elseif event.source == self.btnNot then 
							self.pnlBox:Hide()
							self.pnlStart:Show()
						
						elseif event.source == self.btnYes then
							self.pnlBox:Hide()
							self.button = self.YES
					
						elseif event.source == self.btnSave then
							self:SaveConfig()

						elseif event.source == self.btnCancel then 
							self.pnlOptions:Hide()
							self.pnlStart:Show()

							self:CancelConfig()
					
						end
						
					elseif event.id == Event.WidgetSelect then
						
				
					end 
					
				end

 

Mars.jpg.89ab63a64eebc1f5ada0ab82b66a1f8c.jpg

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...