Implement a basic <Text> component in Cocoa - it's cool because it really just uses the same Component lifecycle. Neat!
This commit is contained in:
parent
22e9628b27
commit
e17f05dec5
11 changed files with 205 additions and 42 deletions
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
use alchemy::{
|
||||
AppDelegate, Component, Fragment, Props, Error, rsx, RSX, styles,
|
||||
View, Window, WindowDelegate
|
||||
Text, View, Window, WindowDelegate
|
||||
};
|
||||
|
||||
pub struct AppState {
|
||||
|
|
@ -48,6 +48,7 @@ impl WindowDelegate for WindowState {
|
|||
|
||||
Ok(rsx! {
|
||||
<View styles={messages}>
|
||||
<Text styles=["message"]>"Hello there, my name is Bert"</Text>
|
||||
<View styles=["boxxx"] />
|
||||
/*{messages.iter().map(|message| rsx! {
|
||||
<View>{text!("{}", message)}</View>
|
||||
|
|
@ -67,6 +68,7 @@ fn main() {
|
|||
let app = alchemy::shared_app();
|
||||
|
||||
app.register_styles("default", styles! {
|
||||
message { width: 500; height: 100; background-color: yellow; color: black; }
|
||||
LOL {
|
||||
background-color: #307ace;
|
||||
width: 500;
|
||||
|
|
|
|||
Reference in a new issue