Sign up

How to set property of cellrenderercombo

I would like to setProperty "model" of a CellRendererCombo.

        auto listStoreManufacturers = new ListStore([GType.STRING]);

        void addManufacturer(string name)
        {
            TreeIter iter = listStoreManufacturers.createIter();
            listStoreManufacturers.setValue(iter, 0, name);
        }

        string[] manufacturers = ["Sony", "LG", "Panasonic", "Nokia", "Samsung", "Toshiba"];

        foreach (manufacturer; manufacturers)
        {
            addManufacturer(manufacturer);
        }

        auto rendererCombo = new CellRendererCombo();
        rendererCombo.setProperty("editable", true);
        rendererCombo.setProperty("model", listStoreManufacturers);

But setProperty is not callable using argument types (string, Liststore)

Is there a way to setProperty "model" of cellrenderercombo?

Re: How to set property of cellrenderercombo

On Sun, 19 Feb 2017 19:44:33 GMT, Erdem wrote:

Is there a way to setProperty "model" of cellrenderercombo?

I ended up calling `g_object_set` directly to do this in Terminix, you can see an example here:

https://github.com/gnunn1/terminix/blob/master/source/gx/terminix/prefeditor/profileeditor.d#L1493

Re: How to set property of cellrenderercombo

On 02/20/2017 03:48 PM, Gerald Nunn wrote:

On Sun, 19 Feb 2017 19:44:33 GMT, Erdem wrote:

Is there a way to setProperty "model" of cellrenderercombo?

I ended up calling `g_object_set` directly to do this in Terminix, you can see an example here:

https://github.com/gnunn1/terminix/blob/master/source/gx/terminix/prefeditor/profileeditor.d#L1493

Or you can wrap it in an gobject.Value, although Value could use an
constructor that accepts ObjectG.

auto val = new Value();
val.init(listStoreManufacturers.getType());
val.setObject(listStoreManufacturers);

rendererCombo.setProperty("model", val);

Re: How to set property of cellrenderercombo

Thanks..