Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/DearImGui.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module DearImGui

-- * Child Windows
, beginChild
, beginChildOfSize
, endChild

-- * Parameter stacks
Expand Down Expand Up @@ -345,6 +346,15 @@ beginChild name = liftIO do
(0 /=) <$> [C.exp| bool { ImGui::BeginChild($(char* namePtr)) } |]


-- | Wraps @ImGui::BeginChild()@ with size param.
beginChildOfSize :: (MonadIO m, HasGetter ref ImVec2) => String -> ref -> m Bool
beginChildOfSize name sizeRef = liftIO do
size <- get sizeRef
withCString name \namePtr ->
with size $ \sizePtr ->
(0 /=) <$> [C.exp| bool { ImGui::BeginChild($(char* namePtr), *$(ImVec2 *sizePtr)) } |]


-- | Wraps @ImGui::EndChild()@.
endChild :: MonadIO m => m ()
endChild = liftIO do
Expand Down