Iced: Setting initial window size

Created on 5 Jun 2020  路  2Comments  路  Source: hecrj/iced

I am building a MFA-type application.

How does one go about setting the initial height and width of the application window ? It should be something trivial to do I'd imagine and yet, no luck. I looked at all the examples and they all start with the very same window dimensions.

I can change the width and height of the widgets themselves. Just not the window (other than using the mouse of course)

Am I being blind here ?

I am running on Linux (arch linux) if that makes a difference for this problem.

Great lib otherwise, still learning how to use it.

Thanks

question

Most helpful comment

Thanks a lot @hecrj . I was pulling my hair on such a trivial goal ;-)

In case anyone else is also wondering:

use iced::{Settings, window};

let settings = Settings {
        window: window::Settings {
            size: (300,500),
            resizable: true,
            decorations: true,
        },
        ..Default::default()
    };

All 2 comments

You should be able to use the window field in Settings when calling Application::run.

Thanks a lot @hecrj . I was pulling my hair on such a trivial goal ;-)

In case anyone else is also wondering:

use iced::{Settings, window};

let settings = Settings {
        window: window::Settings {
            size: (300,500),
            resizable: true,
            decorations: true,
        },
        ..Default::default()
    };
Was this page helpful?
0 / 5 - 0 ratings

Related issues

porglezomp picture porglezomp  路  3Comments

Plecra picture Plecra  路  4Comments

Newbytee picture Newbytee  路  4Comments

CallistoM picture CallistoM  路  3Comments

johannesvollmer picture johannesvollmer  路  4Comments