deech / fltkhs

Haskell bindings to FLTK GUI toolkit.
MIT License
190 stars 24 forks source link

Can't draw a Button? #109

Open mitchellwrosen opened 5 years ago

mitchellwrosen commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

thanks!

On Mon, Apr 22, 2019, 14:01 Mitchell Rosen notifications@github.com wrote:

@sboosali https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deech/fltkhs/issues/109#issuecomment-485551190, or mute the thread https://github.com/notifications/unsubscribe-auth/AARWQMLKV6U3HXT2AKEGYRLPRYRR3ANCNFSM4HHRKJNQ .