Fix existing examples
This commit is contained in:
parent
c507d2e3b2
commit
3a77fd8a91
|
@ -5,7 +5,7 @@ use cacao::color::rgb;
|
|||
use cacao::layout::{Layout, LayoutConstraint};
|
||||
use cacao::view::View;
|
||||
|
||||
use cacao::macos::app::{App, AppDelegate};
|
||||
use cacao::macos::{App, AppDelegate};
|
||||
use cacao::macos::window::{Window, WindowConfig, WindowDelegate};
|
||||
|
||||
struct BasicApp {
|
||||
|
@ -14,6 +14,7 @@ struct BasicApp {
|
|||
|
||||
impl AppDelegate for BasicApp {
|
||||
fn did_finish_launching(&self) {
|
||||
App::activate();
|
||||
self.window.show();
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +29,9 @@ struct AppWindow {
|
|||
}
|
||||
|
||||
impl WindowDelegate for AppWindow {
|
||||
fn did_load(&self, window: Window) {
|
||||
const NAME: &'static str = "WindowDelegate";
|
||||
|
||||
fn did_load(&mut self, window: Window) {
|
||||
window.set_title("AutoLayout Example");
|
||||
window.set_minimum_content_size(300., 300.);
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//! This example showcases setting up a basic application and window.
|
||||
|
||||
use cacao::macos::app::{App, AppDelegate};
|
||||
use cacao::macos::{App, AppDelegate};
|
||||
use cacao::macos::window::Window;
|
||||
|
||||
#[derive(Default)]
|
||||
|
@ -10,6 +10,8 @@ struct BasicApp {
|
|||
|
||||
impl AppDelegate for BasicApp {
|
||||
fn did_finish_launching(&self) {
|
||||
App::activate();
|
||||
|
||||
self.window.set_minimum_content_size(400., 400.);
|
||||
self.window.set_title("A Basic Window");
|
||||
self.window.show();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
//!
|
||||
//! If you're not using that, you can probably get by fine with a standard `NSWindow`.
|
||||
|
||||
use cacao::macos::app::{App, AppDelegate};
|
||||
use cacao::macos::{App, AppDelegate};
|
||||
use cacao::macos::window::{Window, WindowConfig, WindowController, WindowDelegate};
|
||||
|
||||
struct BasicApp {
|
||||
|
@ -13,6 +13,8 @@ struct BasicApp {
|
|||
|
||||
impl AppDelegate for BasicApp {
|
||||
fn did_finish_launching(&self) {
|
||||
App::activate();
|
||||
|
||||
self.window.show();
|
||||
}
|
||||
}
|
||||
|
@ -21,6 +23,8 @@ impl AppDelegate for BasicApp {
|
|||
struct MyWindow;
|
||||
|
||||
impl WindowDelegate for MyWindow {
|
||||
const NAME: &'static str = "MyWindow";
|
||||
|
||||
fn did_load(&mut self, window: Window) {
|
||||
window.set_minimum_content_size(400., 400.);
|
||||
window.set_title("A Basic Window!?");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! This example showcases setting up a basic application and window delegate.
|
||||
//! Window Delegate's give you lifecycle methods that you can respond to.
|
||||
|
||||
use cacao::macos::app::{App, AppDelegate};
|
||||
use cacao::macos::{App, AppDelegate};
|
||||
use cacao::macos::window::{Window, WindowConfig, WindowDelegate};
|
||||
|
||||
struct BasicApp {
|
||||
|
@ -10,6 +10,7 @@ struct BasicApp {
|
|||
|
||||
impl AppDelegate for BasicApp {
|
||||
fn did_finish_launching(&self) {
|
||||
App::activate();
|
||||
self.window.show();
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +19,9 @@ impl AppDelegate for BasicApp {
|
|||
struct MyWindow;
|
||||
|
||||
impl WindowDelegate for MyWindow {
|
||||
fn did_load(&self, window: Window) {
|
||||
const NAME: &'static str = "MyWindow";
|
||||
|
||||
fn did_load(&mut self, window: Window) {
|
||||
window.set_minimum_content_size(400., 400.);
|
||||
window.set_title("A Basic Window!?");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue