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

Generate ComboBox::set_active by hand #750

Merged
merged 3 commits into from Dec 19, 2018

Conversation

Projects
None yet
3 participants
@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Dec 16, 2018

use glib::object::IsA;

pub trait ComboBoxExtManual {
fn set_active<'a, P: Into<Option<u32>>>(&self, index_: P);

This comment has been minimized.

@EPashkin

EPashkin Dec 17, 2018

Member

'a is really needed ?

This comment has been minimized.

@sdroege

sdroege Dec 17, 2018

Member

No, and I'm surprised it's not a compiler warning :)

This comment has been minimized.

@EPashkin

EPashkin Dec 18, 2018

Member

'a still there

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Dec 17, 2018

ComboBoxExtManual need be in prelude, and old function ignored

@sdroege

This comment has been minimized.

Copy link
Member

sdroege commented Dec 17, 2018

looks good to me apart from what @EPashkin said

@GuillaumeGomez GuillaumeGomez force-pushed the GuillaumeGomez:set-active branch from fec2df1 to 5c1419f Dec 17, 2018

@GuillaumeGomez

This comment has been minimized.

Copy link
Member Author

GuillaumeGomez commented Dec 17, 2018

I completely forgot to commit all files, sorry...

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Dec 18, 2018

Seems we need generate only notify for property "active",
and gtk_combo_box_get_active seems need be manual with Option<i32> with None`for -1

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Dec 18, 2018

Why don't ignore property getter and setter?

    [[object.property]]
    name = "active"
    #manual Option
    generate = ["notify"]
@@ -447,6 +435,20 @@ impl<O: IsA<ComboBox> + IsA<glib::object::Object> + glib::object::ObjectExt> Com
}
}

fn get_property_active(&self) -> i32 {

This comment has been minimized.

@sdroege

sdroege Dec 18, 2018

Member

The property functions should disappear (but notify should stay), otherwise looks good to me

@EPashkin

This comment has been minimized.

Copy link
Member

EPashkin commented Dec 18, 2018

@GuillaumeGomez thanks, 👍

@GuillaumeGomez GuillaumeGomez merged commit bb52e13 into gtk-rs:master Dec 19, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details

@GuillaumeGomez GuillaumeGomez deleted the GuillaumeGomez:set-active branch Dec 19, 2018

vhdirk pushed a commit to vhdirk/gtk-rs that referenced this pull request Jan 16, 2019

Merge pull request gtk-rs#750 from GuillaumeGomez/set-active
Generate ComboBox::set_active by hand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.