pub struct RunLoop { /* private fields */ }Implementations§
Source§impl RunLoop
impl RunLoop
Sourcepub fn new() -> RunLoop
pub fn new() -> RunLoop
Examples found in repository?
examples/hello.rs (line 107)
98fn main() {
99 druid_win_shell::init();
100
101 let mut file_menu = Menu::new();
102 file_menu.add_item(0x100, "E&xit");
103 file_menu.add_item(0x101, "O&pen");
104 let mut menubar = Menu::new();
105 menubar.add_dropdown(file_menu, "&File");
106
107 let mut run_loop = win_main::RunLoop::new();
108 let mut builder = WindowBuilder::new();
109 builder.set_handler(Box::new(HelloState::default()));
110 builder.set_title("Hello example");
111 builder.set_menu(menubar);
112 let window = builder.build().unwrap();
113 window.show();
114 run_loop.run();
115}More examples
examples/perftest.rs (line 127)
124fn main() {
125 druid_win_shell::init();
126
127 let mut run_loop = win_main::RunLoop::new();
128 let mut builder = WindowBuilder::new();
129 let perf_state = PerfState {
130 dwrite_factory: directwrite::Factory::new().unwrap(),
131 handle: Default::default(),
132 last_time: 0.0,
133 };
134 builder.set_handler(Box::new(PerfTest(RefCell::new(perf_state))));
135 builder.set_title("Performance tester");
136 // Note: experiment with changing this
137 builder.set_present_strategy(PresentStrategy::FlipRedirect);
138 let window = builder.build().unwrap();
139 window.show();
140 run_loop.run();
141}Sourcepub fn get_handle(&self) -> RunLoopHandle
pub fn get_handle(&self) -> RunLoopHandle
Get a handle to the run loop state so a client can add listeners, etc.
Sourcepub fn run(&mut self)
pub fn run(&mut self)
Examples found in repository?
examples/hello.rs (line 114)
98fn main() {
99 druid_win_shell::init();
100
101 let mut file_menu = Menu::new();
102 file_menu.add_item(0x100, "E&xit");
103 file_menu.add_item(0x101, "O&pen");
104 let mut menubar = Menu::new();
105 menubar.add_dropdown(file_menu, "&File");
106
107 let mut run_loop = win_main::RunLoop::new();
108 let mut builder = WindowBuilder::new();
109 builder.set_handler(Box::new(HelloState::default()));
110 builder.set_title("Hello example");
111 builder.set_menu(menubar);
112 let window = builder.build().unwrap();
113 window.show();
114 run_loop.run();
115}More examples
examples/perftest.rs (line 140)
124fn main() {
125 druid_win_shell::init();
126
127 let mut run_loop = win_main::RunLoop::new();
128 let mut builder = WindowBuilder::new();
129 let perf_state = PerfState {
130 dwrite_factory: directwrite::Factory::new().unwrap(),
131 handle: Default::default(),
132 last_time: 0.0,
133 };
134 builder.set_handler(Box::new(PerfTest(RefCell::new(perf_state))));
135 builder.set_title("Performance tester");
136 // Note: experiment with changing this
137 builder.set_present_strategy(PresentStrategy::FlipRedirect);
138 let window = builder.build().unwrap();
139 window.show();
140 run_loop.run();
141}Auto Trait Implementations§
impl Freeze for RunLoop
impl RefUnwindSafe for RunLoop
impl !Send for RunLoop
impl !Sync for RunLoop
impl Unpin for RunLoop
impl UnwindSafe for RunLoop
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more