-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathhello1.rs
28 lines (22 loc) · 843 Bytes
/
hello1.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! Example based on hello1 from http://wiki.call-cc.org/iup-tutor
#[macro_use]
extern crate iup;
use iup::prelude::*;
use iup::layout::VBox;
use iup::control::{Button, Label};
fn main () {
iup::with_iup(|| {
let button = Button::with_title("Ok")
.set_attrib("EXPAND", "YES")
.set_attrib("TIP", "Exit button")
.set_action(|_| CallbackReturn::Close);
let label = Label::with_title("Hello, world!");
let vbox = VBox::new(elements![label, button])
.set_attrib("GAP", "10")
.set_attrib("MARGIN", "10x10")
.set_attrib("ALIGNMENT", "ACENTER");
Dialog::new(vbox)
.set_attrib("TITLE", "Hello")
.show()
}).unwrap();
}