diff --git a/src/DearImGui.hs b/src/DearImGui.hs index f608843..3f3e8d3 100644 --- a/src/DearImGui.hs +++ b/src/DearImGui.hs @@ -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 diff --git a/src/DearImGui/Raw.hs b/src/DearImGui/Raw.hs index 89ed760..24b00c7 100644 --- a/src/DearImGui/Raw.hs +++ b/src/DearImGui/Raw.hs @@ -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