Skip to content

elements not appearing #234

@andrewzah

Description

@andrewzah

Description

Version / OS

  • azul version: dcc69cd12acc77676ce2228064395228d17eac93@unvendor_dependencies.

  • Operating system: debian 9

  • Windowing system (X11 or Wayland, Linux only): X11

Steps to Reproduce

cargo run with:

use std::time::Duration;

use azul::{
    prelude::*,
    widgets::{button::Button, label::Label},
};

struct DataModel {
    counter: usize,
}

impl Layout for DataModel {
    fn layout(&self, _: LayoutInfo) -> Dom<Self> {

        let dom = Dom::div().with_id("first_line")
            .with_child(Label::new("Child IP: ").dom().with_id("child_ip_label"))
            .with_child(
                Dom::div().with_id("other")
                    .with_child(Label::new("Child IP 2: ").dom().with_id("child_ip_label2"))
            );


        println!("dom: \n{}", dom.get_html_string());
        dom

    }
}

fn main() {
    let mut cfg = AppConfig::default();
    cfg.enable_logging = Some(LevelFilter::Trace);

    let model = DataModel { counter: 0 };
    let app = App::new(model, cfg).unwrap();

    let window = WindowCreateOptions::new(css::override_native( include_str!("main.css")).unwrap());
    app.run(window);
}
#first_line {
    flex-direction: row;
    margin: 0px;
    padding: 0px;
    background-color: green;
}

#other {
    flex-grow: 3;
    background-color: red;
}

#child_ip_label {
    flex-grow: 1;
}

When I run this, I just get a blank green screen. No elements appear.

this is the generated html:

<div id="first_line">
    <p id="child_ip_label" class="__azul-native-label">
        Child IP:
    </p>
    <div id="other">
        <p id="child_ip_label2" class="__azul-native-label">
            Child IP 2:
        </p>
    </div>
</div>

Additional Information

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplatform:linuxIssue appears on Linux

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions