-
Notifications
You must be signed in to change notification settings - Fork 25
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
What is the purpose of duplicate functions? #115
Comments
It's so one can call base class methods. While the type signatures are the same the underlying method call is different. |
I see... I'm still having some difficulty understanding. Which call is which? I'm not entirely clear on what |
I read over the docs a bit more and I'm starting to understand. My understanding now is that in |
Yes exactly and I admit this is confusing. Basically the inheritance chain looks like:
where |
Interesting! A follow-up question, if I were to write my own
Or like this?
If the former, is there any functionality in |
If you want to create your own button you'd use |
Got it. Another question (sorry!) - the getParent :: Ref WidgetBase -> IO (Maybe (Ref GroupBase)) you're going to get back a |
Also while this is limiting you can do quite a bit with just those. The entire fltkhs-themes package relies mostly custon |
Ah yes, they do crop up in return types, you're right. You don't want a |
Very helpful! Could you clarify why one might not want to immediately upcast every |
Oh - is the answer that in doing so, you'd toss out your custom overrides? |
Hmm.. let me think about that. You maybe right, you can't really add member functions to a child when you override so a |
For example, the
Button
module defineshandleButtonBase
resizeButtonBase
hideButtonBase
showWidgetButtonBase
but there also exists
impl ~ (Event -> IO (Either UnknownEvent ())) => Op (Handle ()) ButtonBase orig impl
with (as far as I can tell) the same types. Is there a difference between these? Thanks!
The text was updated successfully, but these errors were encountered: