File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,12 @@ loop w checked = do
48
48
True -> openPopup " Button Popup"
49
49
False -> return ()
50
50
51
- beginPopupModal " Button Popup" >>= whenTrue do
51
+ isItemHovered >>= whenTrue do
52
+ beginTooltip
53
+ text " Tooltip?"
54
+ endTooltip
55
+
56
+ beginPopup " Button Popup" >>= whenTrue do
52
57
button " Close" >>= whenTrue closeCurrentPopup
53
58
endPopup
54
59
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ module DearImGui
80
80
, endMenu
81
81
, menuItem
82
82
83
+ -- * Tooltips
84
+ , beginTooltip
85
+ , endTooltip
86
+
83
87
-- * Popups/Modals
84
88
, beginPopup
85
89
, beginPopupModal
@@ -493,6 +497,21 @@ menuItem label = liftIO do
493
497
(1 == ) <$> [C. exp | bool { MenuItem($(char* labelPtr)) } |]
494
498
495
499
500
+ -- | Begin/append a tooltip window to create full-featured tooltip (with any
501
+ -- kind of items).
502
+ --
503
+ -- Wraps @ImGui::BeginTooltip()@
504
+ beginTooltip :: MonadIO m => m ()
505
+ beginTooltip = liftIO do
506
+ [C. exp | void { BeginTooltip() } |]
507
+
508
+
509
+ -- | Wraps @ImGui::EndTooltip()@
510
+ endTooltip :: MonadIO m => m ()
511
+ endTooltip = liftIO do
512
+ [C. exp | void { EndTooltip() } |]
513
+
514
+
496
515
-- | Returns 'True' if the popup is open, and you can start outputting to it.
497
516
--
498
517
-- Wraps @ImGui::BeginPopup()@
You can’t perform that action at this time.
0 commit comments