Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't draw a Button? #109

Open
mitchellwrosen opened this issue Apr 22, 2019 · 5 comments
Open

Can't draw a Button? #109

mitchellwrosen opened this issue Apr 22, 2019 · 5 comments

Comments

@mitchellwrosen
Copy link
Contributor

Calling draw on a Ref Button is a type error:

• Draw is not supported by Graphics.UI.FLTK.LowLevel.Hierarchy.CButtonGraphics.UI.FLTK.LowLevel.Hierarchy.ButtonBaseFuncs

However, it seems like it should be able to, per the hierarchy Base.Widget -> Base.Button

@deech
Copy link
Owner

deech commented Apr 22, 2019

Direct calls to draw are not recommended, redraw is recommended because it correctly queues the widget in the event loop. Also thanks for pointing out this doc bug,

That said if redraw doesn't fit your needs I can expose as a direct function call as I do with clocks.

@mitchellwrosen
Copy link
Contributor Author

Thanks for the tips, I'm just messing around with wrapping this library in a more haddock-friendly / idiomatic way, I'm not actually drawing buttons just yet :)

@sboosali
Copy link
Contributor

@mitchellwrosen could you ping me if you release such a package? i also want to write my own wrappers over an FLTKHS subset (for my personal applications).

@mitchellwrosen
Copy link
Contributor Author

@sboosali Sure, you can follow my progress here https://github.com/mitchellwrosen/fltkhs-simple

It's really nothing special, my idea is to simply use concrete newtypes around refs, and to wrap/re-expose their entire APIs (including all parent types) individually. There are probably lots of reasons why I would not want to do this, but I'm just trying to learn the API at the moment, and wrapping helps with that.

@sboosali
Copy link
Contributor

sboosali commented Apr 22, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants