mirror of
https://github.com/Drezil/dear-imgui.hs.git
synced 2025-07-07 13:35:50 +02:00
Wrap ImGui::TreeNode, TreePush, TreePop (#24)
This commit is contained in:
@ -83,6 +83,11 @@ module DearImGui
|
||||
, colorPicker3
|
||||
, colorButton
|
||||
|
||||
-- * Trees
|
||||
, treeNode
|
||||
, treePush
|
||||
, treePop
|
||||
|
||||
-- ** Selectables
|
||||
, selectable
|
||||
|
||||
@ -583,6 +588,25 @@ colorButton desc ref = liftIO do
|
||||
|
||||
return changed
|
||||
|
||||
-- | Wraps @ImGui::TreeNode()@.
|
||||
treeNode :: MonadIO m => String -> m Bool
|
||||
treeNode label = liftIO do
|
||||
withCString label \labelPtr ->
|
||||
(0 /=) <$> [C.exp| bool { TreeNode($(char* labelPtr)) } |]
|
||||
|
||||
|
||||
-- | Wraps @ImGui::TreePush()@.
|
||||
treePush :: MonadIO m => String -> m ()
|
||||
treePush label = liftIO do
|
||||
withCString label \labelPtr ->
|
||||
[C.exp| void { TreePush($(char* labelPtr)) } |]
|
||||
|
||||
|
||||
-- | Wraps @ImGui::TreePop()@.
|
||||
treePop :: MonadIO m => m ()
|
||||
treePop = liftIO do
|
||||
[C.exp| void { TreePop() } |]
|
||||
|
||||
|
||||
-- | Wraps @ImGui::Selectable()@.
|
||||
selectable :: MonadIO m => String -> m Bool
|
||||
|
Reference in New Issue
Block a user