Skip to content

Commit 8df98e0

Browse files
authored
Fix TabItem flags type (#183)
Resolves #175
1 parent 6dbb455 commit 8df98e0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ loop window checked color slider r pos size' selected tab1Ref tab2Ref = do
7979
text "Hello!"
8080

8181
beginTabBar "My tab bar" ImGuiTabBarFlags_Reorderable >>= whenTrue do
82-
beginTabItem "Tab 1" tab1Ref ImGuiTabBarFlags_None >>= whenTrue do
82+
beginTabItem "Tab 1" tab1Ref ImGuiTabItemFlags_None >>= whenTrue do
8383
text "Tab 1 is currently selected."
8484
endTabItem
85-
beginTabItem "Tab 2" tab2Ref ImGuiTabBarFlags_None >>= whenTrue do
85+
beginTabItem "Tab 2" tab2Ref ImGuiTabItemFlags_None >>= whenTrue do
8686
text "Tab 2 is selected now."
8787
endTabItem
8888
reOpen <- tabItemButton "ReopenTabs" ImGuiTabItemFlags_Trailing

src/DearImGui.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,7 +1690,7 @@ withTabBarOpen tabBarID flags action =
16901690
-- | Create a new tab. Returns @True@ if the tab is selected.
16911691
--
16921692
-- Wraps @ImGui::BeginTabItem@.
1693-
beginTabItem :: (MonadIO m, HasGetter ref Bool, HasSetter ref Bool) => Text -> ref -> ImGuiTabBarFlags -> m Bool
1693+
beginTabItem :: (MonadIO m, HasGetter ref Bool, HasSetter ref Bool) => Text -> ref -> ImGuiTabItemFlags -> m Bool
16941694
beginTabItem tabName ref flags = liftIO do
16951695
currentValue <- get ref
16961696
with (bool 0 1 currentValue) \refPtr -> do
@@ -1706,14 +1706,14 @@ beginTabItem tabName ref flags = liftIO do
17061706
-- | Create a new tab.
17071707
--
17081708
-- The action will get 'True' if the tab is selected.
1709-
withTabItem :: (MonadUnliftIO m, HasGetter ref Bool, HasSetter ref Bool) => Text -> ref -> ImGuiTabBarFlags -> (Bool -> m a) -> m a
1709+
withTabItem :: (MonadUnliftIO m, HasGetter ref Bool, HasSetter ref Bool) => Text -> ref -> ImGuiTabItemFlags -> (Bool -> m a) -> m a
17101710
withTabItem tabName ref flags =
17111711
bracket (beginTabItem tabName ref flags) (`when` Raw.endTabItem)
17121712

17131713
-- | Create a new tab.
17141714
--
17151715
-- The action will be skipped unless the tab is selected.
1716-
withTabItemOpen :: (MonadUnliftIO m, HasGetter ref Bool, HasSetter ref Bool) => Text -> ref -> ImGuiTabBarFlags -> m () -> m ()
1716+
withTabItemOpen :: (MonadUnliftIO m, HasGetter ref Bool, HasSetter ref Bool) => Text -> ref -> ImGuiTabItemFlags -> m () -> m ()
17171717
withTabItemOpen tabName ref flags action =
17181718
withTabItem tabName ref flags (`when` action)
17191719

src/DearImGui/Raw.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,9 +1346,9 @@ endTabBar = liftIO do
13461346
-- | Create a new tab. Returns @True@ if the tab is selected.
13471347
--
13481348
-- Wraps @ImGui::BeginTabItem@.
1349-
beginTabItem :: (MonadIO m) => CString -> Ptr CBool -> ImGuiTabBarFlags -> m Bool
1349+
beginTabItem :: (MonadIO m) => CString -> Ptr CBool -> ImGuiTabItemFlags -> m Bool
13501350
beginTabItem namePtr refPtr flags = liftIO do
1351-
(0 /=) <$> [C.exp| bool { BeginTabItem($(char* namePtr), $(bool* refPtr), $(ImGuiTabBarFlags flags) ) } |]
1351+
(0 /=) <$> [C.exp| bool { BeginTabItem($(char* namePtr), $(bool* refPtr), $(ImGuiTabItemFlags flags) ) } |]
13521352

13531353

13541354
-- | Finish appending elements to a tab. Only call if 'beginTabItem' returns @True@.

0 commit comments

Comments
 (0)