-
-
Notifications
You must be signed in to change notification settings - Fork 82
subclass/widget: Implement default handling for parent events #921
subclass/widget: Implement default handling for parent events #921
Conversation
.expect("No parent class impl for \"button_press_event\""); | ||
let ev_glib = glib::translate::mut_override(event.to_glib_none().0); | ||
Inhibit(from_glib(f(widget.to_glib_none().0, ev_glib))) | ||
if let Some(f) = (*parent_class).button_press_event { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this part be macro?
call_parent!(button_press_event, f(widget.to_glib_none().0, ev_glib))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because it looks different depending on what the parent class expects by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
|
Looks good, I think. Only container and widget's compute_expand() missing now :) |
Added compute expand now, though given how simple it looks I am not sure if that's what you had in mind? |
Yes exactly that. Then only the GtkContainer virtual methods are missing and then we're good to go here :) |
oh whoops, forgot aobut container |
👍 |
…default handling for parent events Close #916
Should be good to go! |
I agree :) Also your examples PR should be good to merge then? |
Okay, that's the last of the panics I am hitting it seems \o/ |
🙌 Let's get this in then once the CI is green |
Thanks! |
Close #916