relm icon indicating copy to clipboard operation
relm copied to clipboard

gtk properties can only have one argument using attributes

Open etrombly opened this issue 8 years ago • 8 comments

Not sure if there is an easy fix to this, but I was trying to set the policy on a scrolled window. It requires the policy for the horizontal and vertical scrollbar, but you can only pass one argument.

gtk::ScrolledWindow {
    policy: (gtk::PolicyType::Never, gtk::PolicyType::Automatic),

edit: realized afterwords there is a separate vscrollbar and hscrollbar policy, but this might still be relevant for other properties.

etrombly avatar Aug 10 '17 20:08 etrombly

Yeah, multiple value properties are not supported. You have 2 alternatives:

If there are other properties like that, please tell me and I'll fix that on a case-by-case basis (perhaps even in gtk-rs itself).

antoyo avatar Aug 11 '17 04:08 antoyo

hscroll_policy is working. If I find any others I'll report here. Thanks

etrombly avatar Aug 11 '17 07:08 etrombly

Is this the same thing as trying to do set_size_request?

superlou avatar Aug 15 '17 17:08 superlou

@superlou: For that, there's property_height_request.

antoyo avatar Aug 15 '17 17:08 antoyo

That works, thanks.

superlou avatar Aug 16 '17 00:08 superlou

What about Image.set_from_icon_name? init_view method works, but setting from macro would be much nicer.

konchunas avatar Jan 31 '19 18:01 konchunas

Hey, init_view() is a bit inconvenient, so I'd like to add support for this. Any suggestions on how I can contribute? I sifted through the code but can't seem to find the view macro anywhere, could use some help navigating.

giraffekey avatar Jul 18 '20 15:07 giraffekey

@GiraffeKey: You'll have to parse more than one Value here. Or maybe a new type Values based on this which parses multiple Expr separated by commas.

For the syntax, I'm not sure, because I think there are some arguments that are tuples.

If you need more help, I'll be happy to provide more details.

antoyo avatar Jul 18 '20 20:07 antoyo