mirror of
				https://github.com/Drezil/dear-imgui.hs.git
				synced 2025-11-04 15:11:06 +01:00 
			
		
		
		
	Add remaining popup wrappers (#136)
- BeginPopupContextItem - BeginPopupContextWindow - BeginPopupContextVoid For #132
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							4517af8123
						
					
				
				
					commit
					fc307a4d6e
				
			@@ -67,25 +67,12 @@ mainLoop win = do
 | 
			
		||||
      clicking <- button "Clickety Click"
 | 
			
		||||
      when clicking $
 | 
			
		||||
        putStrLn "Ow!"
 | 
			
		||||
 | 
			
		||||
      -- Attach a popup to the latest widget
 | 
			
		||||
      let popupId = "pop-me"
 | 
			
		||||
      openPopupOnItemClick popupId ImGuiPopupFlags_MouseButtonRight
 | 
			
		||||
 | 
			
		||||
      -- Put some content into a popup window
 | 
			
		||||
      -- alternatively: withPopup (closes automatically)
 | 
			
		||||
      withPopupModalOpen popupId do
 | 
			
		||||
      itemContextPopup do
 | 
			
		||||
        text "pop!"
 | 
			
		||||
        button "ok" >>= \clicked ->
 | 
			
		||||
          when clicked $
 | 
			
		||||
            closeCurrentPopup
 | 
			
		||||
 | 
			
		||||
      -- Query popup status
 | 
			
		||||
      popping <- isCurrentPopupOpen popupId
 | 
			
		||||
      when popping do
 | 
			
		||||
        sameLine
 | 
			
		||||
        text "Popping right now."
 | 
			
		||||
 | 
			
		||||
    -- Show the ImGui demo window
 | 
			
		||||
    showDemoWindow
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user