Skip to content

Commit 85c6f34

Browse files
committed
Wrap ImGui::SameLine()
1 parent bfa31b5 commit 85c6f34

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Main.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ loop w checked = do
4848
True -> putStrLn "Oh hi Mark"
4949
False -> return ()
5050

51-
smallButton "Click me" >>= \case
51+
sameLine >> smallButton "Click me" >>= \case
5252
True -> putStrLn "Oh hi Mark"
5353
False -> return ()
5454

55-
arrowButton "Arrow" ImGuiDirUp
55+
sameLine >> arrowButton "Arrow" ImGuiDirUp
5656

57-
checkbox "Check!" checked >>= \case
57+
sameLine >> checkbox "Check!" checked >>= \case
5858
True -> readIORef checked >>= print
5959
False -> return ()
6060

src/DearImGui.hs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ module DearImGui
4848
, begin
4949
, end
5050

51+
-- * Cursor/Layout
52+
, sameLine
53+
5154
-- * Widgets
5255
-- ** Text
5356
, text
@@ -308,6 +311,14 @@ end = liftIO do
308311
[C.exp| void { ImGui::End(); } |]
309312

310313

314+
-- | Call between widgets or groups to layout them horizontally.
315+
--
316+
-- Wraps @ImGui::SameLine@.
317+
sameLine :: MonadIO m => m ()
318+
sameLine = liftIO do
319+
[C.exp| void { SameLine(); } |]
320+
321+
311322
-- | Formatted text.
312323
--
313324
-- Wraps @ImGui::Text()@.

0 commit comments

Comments
 (0)