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

elements not appearing #234

Open
andrewzah opened this issue Dec 24, 2019 · 1 comment
Open

elements not appearing #234

andrewzah opened this issue Dec 24, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@andrewzah
Copy link

andrewzah commented Dec 24, 2019

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

@andrewzah andrewzah added the bug Something isn't working label Dec 24, 2019
@fschutt
Copy link
Owner

fschutt commented Jan 3, 2020

Yeah, I know about the issues with unvendor_dependencies. The new, rewritten layout solver is all kinds of fucked and I didn't have the time to work on it in December, so it's just in a pretty sad state right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants