mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2024-11-22 00:47: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
|
||||
, 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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user