mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-11-22 16:57:00 +00:00
Add setNextItemOpen (#161)
This change enables starting a new TreeNode open.
This commit is contained in:
parent
a2feb73fa5
commit
48486ee8c2
@ -226,6 +226,7 @@ module DearImGui
|
|||||||
, treeNode
|
, treeNode
|
||||||
, treePush
|
, treePush
|
||||||
, Raw.treePop
|
, Raw.treePop
|
||||||
|
, setNextItemOpen
|
||||||
|
|
||||||
-- ** Selectables
|
-- ** Selectables
|
||||||
, selectable
|
, selectable
|
||||||
@ -1546,6 +1547,9 @@ treePush :: MonadIO m => Text -> m ()
|
|||||||
treePush label = liftIO do
|
treePush label = liftIO do
|
||||||
Text.withCString label Raw.treePush
|
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.
|
-- | Wraps @ImGui::Selectable()@ with default options.
|
||||||
selectable :: MonadIO m => Text -> m Bool
|
selectable :: MonadIO m => Text -> m Bool
|
||||||
|
@ -185,6 +185,7 @@ module DearImGui.Raw
|
|||||||
, treeNode
|
, treeNode
|
||||||
, treePush
|
, treePush
|
||||||
, treePop
|
, treePop
|
||||||
|
, setNextItemOpen
|
||||||
|
|
||||||
-- ** Selectables
|
-- ** Selectables
|
||||||
, selectable
|
, selectable
|
||||||
@ -1233,6 +1234,11 @@ treePop = liftIO do
|
|||||||
[C.exp| void { TreePop() } |]
|
[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()@.
|
-- -- | Wraps @ImGui::Selectable()@.
|
||||||
-- selectable :: (MonadIO m) => CString -> m Bool
|
-- selectable :: (MonadIO m) => CString -> m Bool
|
||||||
-- selectable labelPtr = liftIO do
|
-- selectable labelPtr = liftIO do
|
||||||
|
Loading…
Reference in New Issue
Block a user