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

Signals with optional parameters #241

Closed
EPashkin opened this issue Apr 21, 2016 · 2 comments
Closed

Signals with optional parameters #241

EPashkin opened this issue Apr 21, 2016 · 2 comments

Comments

@EPashkin
Copy link
Member

Part of #199
ListBox: row-selected
Widget: hierarchy-changed, parent-set

For closure Fn(&ListBox, Option<&ListBoxRow>) + 'static> generated generated bad code.
Not sure if it need be fixed in gir or in glib\gtk.

unsafe extern "C" fn row_selected_trampoline(this: *mut GtkListBox, row: *mut GtkListBoxRow, f: gpointer) {
    callback_guard!();
    let f: &Box_<Fn(&ListBox, Option<&ListBoxRow>) + 'static> = transmute(f);
    f(&from_glib_none(this), Option<ListBoxRow>::from_glib_none(row))
}
@EPashkin
Copy link
Member Author

EPashkin commented May 3, 2016

Added partial fix

@EPashkin
Copy link
Member Author

Seems gir generated working code, I close this.

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

1 participant