Hello,
I am a relatively new rust user, and I am trying to utilize the orbtk crate to make gui applications, however I can't seem to get the minimal example(GitHub - redox-os/orbtk: The Rust UI-Toolkit.) to compile. I installed the dependacy on ubuntu with apt as described here, https://github.com/Rust-SDL2/rust-sdl2#linux, and all seemed to be well, and I pasted orbtk = "0.3.1-alpha1" into my toml file, and had this code in main.rs:
use orbtk::prelude::*;
fn main() {
Application::new()
.window(|ctx| {
Window::new()
.title("OrbTk - minimal example")
.position((100.0, 100.0))
.size(420.0, 730.0)
.child(ctx, TextBlock::new().text("OrbTk").build(ctx))
.build(ctx)
})
.run();
}
However, I tried to compile it, and got this:
error[E0599]: no function or associated item named `new` found for struct `orbtk_widgets::window::Window` in the current scope
--> src/main.rs:6:21
|
6 | Window::new()
| ^^^ function or associated item not found in `orbtk_widgets::window::Window`
error[E0599]: no function or associated item named `new` found for struct `orbtk_widgets::text_block::TextBlock` in the current scope
--> src/main.rs:10:40
|
10 | .child(ctx, TextBlock::new().text("OrbTk").build(ctx))
| ^^^ function or associated item not found in `orbtk_widgets::text_block::TextBlock`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0599`.
error: could not compile `orbtk-tester`.
To learn more, run the command again with --verbose.
What am I doing wrong here (or is it possible that the example is out dated)? I could have opened an issue for this on github, but I figured I was just being a Dunce and doing something wrong.