Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ui
- fn crypt(mut app App) {
- println('${app.tcrypt}')
- }
- struct App {
- mut:
- window &ui.Window
- tcrypt string
- scrypt &ui.Button
- }
- mut app := &App{
- window: 0
- }
- app.scrypt = ui.button(
- height: 30
- width: 120
- text: 'crypter'
- on_click: fn [mut app] (btn &ui.Button) {
- crypt(mut app)
- }
- )
- app.window = ui.window(
- height: 500
- width: 800
- title: 'iccs'
- children: [
- ui.column(
- margin: ui.Margin{20, 20, 20, 20}
- children: [
- ui.textbox(
- height: 30
- width: 120
- text: &app.tcrypt
- placeholder: 'Texte à crypter'
- ),
- app.scrypt,
- ]
- ),
- ]
- )
- ui.run(app.window)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement