Add setNextItemOpen (#161)

This change enables starting a new TreeNode open.
This commit is contained in:
Tristan de Cacqueray 2022-11-28 12:56:27 +00:00 committed by GitHub
parent a2feb73fa5
commit 48486ee8c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -226,6 +226,7 @@ module DearImGui
, treeNode
, treePush
, Raw.treePop
, setNextItemOpen
-- ** Selectables
, selectable
@ -1546,6 +1547,9 @@ treePush :: MonadIO m => Text -> m ()
treePush label = liftIO do
Text.withCString label Raw.treePush
-- | Wraps @ImGui::SetNextItemOpen()@.
setNextItemOpen :: MonadIO m => Bool -> m ()
setNextItemOpen is_open = Raw.setNextItemOpen (bool 0 1 is_open)
-- | Wraps @ImGui::Selectable()@ with default options.
selectable :: MonadIO m => Text -> m Bool

View File

@ -185,6 +185,7 @@ module DearImGui.Raw
, treeNode
, treePush
, treePop
, setNextItemOpen
-- ** Selectables
, selectable
@ -1233,6 +1234,11 @@ treePop = liftIO do
[C.exp| void { TreePop() } |]
-- | Wraps @ImGui::SetNextItemOpen()@.
setNextItemOpen :: (MonadIO m) => CBool -> m ()
setNextItemOpen is_open = liftIO do
[C.exp| void { SetNextItemOpen($(bool is_open)) } |]
-- -- | Wraps @ImGui::Selectable()@.
-- selectable :: (MonadIO m) => CString -> m Bool
-- selectable labelPtr = liftIO do