ui_show(self.ptr);
}
}
+
+ pub fn set_size(&mut self, width: u32, height: u32) {
+ unsafe {
+ ui_window_size(self.ptr, width as c_int, height as c_int);
+ }
+ }
+
+ pub fn set_menubar_visible(&mut self, visible: bool) {
+ unsafe {
+ ui_window_menubar_set_visible(self.ptr, visible as c_int);
+ }
+ }
+
+ pub fn enable_fullscreen(&mut self, fullscreen: bool) {
+ unsafe {
+ ui_window_fullscreen(self.ptr, fullscreen as c_int);
+ }
+ }
}
/* ---------------------------------- main windows ---------------------------------- */
obj
}
-impl<T> toolkit::UiObject<T> {
- pub fn set_size(&mut self, width: u32, height: u32) {
- unsafe {
- ui_window_size(self.ptr, width as c_int, height as c_int);
- }
- }
-
- pub fn set_menubar_visible(&mut self, visible: bool) {
- unsafe {
- ui_window_menubar_set_visible(self.ptr, visible as c_int);
- }
- }
-
- pub fn enable_fullscreen(&mut self, fullscreen: bool) {
- unsafe {
- ui_window_fullscreen(self.ptr, fullscreen as c_int);
- }
- }
-}
impl<T: UiModel + UiActions> AppContext<T> {
pub fn window<F>(&self, title: &str, data: T, create_ui: F) -> toolkit::UiObject<T>