Skip to content

Expose flags to widgets #154

@ailrk

Description

@ailrk

Hey all,
I'm trying to make an inputText that returns true when an enter is hit, which requires the ImGuiInputTextFlags_EnterReturnsTrue flag. I notice all flags are already there, but most widgets are set with a default value instead of exposing it to the public interface, I find it is a bit limiting. Is there a reason for this? e.g for this piece:

dear-imgui.hs/src/DearImGui.hs

Lines 1216 to 1224 in 7795b3d

-- | Wraps @ImGui::InputText()@.
inputText :: (MonadIO m, HasSetter ref Text, HasGetter ref Text) => Text -> ref -> Int -> m Bool
inputText label ref bufSize =
withInputString ref bufSize \bufPtrLen ->
Text.withCString label \labelPtr ->
Raw.inputText
labelPtr
bufPtrLen
ImGuiInputTextFlags_None

Can we expose the flag as an option to the user like this?

 inputText :: (MonadIO m, HasSetter ref Text, HasGetter ref Text) => Text -> ref -> Int -> ImGuiInputTextFlags -> m Bool 

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions