Add invisibleButton (#91)

This commit is contained in:
Alexander Bondarenko
2021-09-11 14:01:03 +03:00
committed by GitHub
parent efaaa5723a
commit 4bfc7e7099
2 changed files with 33 additions and 0 deletions

View File

@ -99,6 +99,7 @@ module DearImGui.Raw
-- ** Main
, button
, smallButton
, invisibleButton
, arrowButton
, checkbox
, progressBar
@ -478,6 +479,24 @@ smallButton labelPtr = liftIO do
(0 /=) <$> [C.exp| bool { SmallButton($(char* labelPtr)) } |]
-- | Flexible button behavior without the visuals.
--
-- Frequently useful to build custom behaviors using the public api
-- (along with IsItemActive, IsItemHovered, etc).
--
-- Wraps @ImGui::InvisibleButton()@.
invisibleButton :: (MonadIO m) => CString -> Ptr ImVec2 -> ImGuiButtonFlags -> m Bool
invisibleButton labelPtr size flags = liftIO do
(0 /=) <$> [C.exp|
bool {
InvisibleButton(
$(char* labelPtr),
*$(ImVec2* size),
$(ImGuiButtonFlags flags)
)
}
|]
-- | Square button with an arrow shape.
--
-- Wraps @ImGui::ArrowButton()@.