Rust und Racket
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
```racket
|
||||
#lang racket
|
||||
|
||||
; https://dev.to/goober99/learn-racket-by-example-gui-programming-3epm
|
||||
|
||||
(require racket/gui/base)
|
||||
|
||||
; 1. Hauptfenster (Frame) erstellen
|
||||
(define frame (new frame% [label "Hallo Racket"]
|
||||
[width 300]
|
||||
[height 200]))
|
||||
|
||||
; 2. Einen Button zum Fenster hinzufügen
|
||||
(define btn (new button% [parent frame]
|
||||
[label "Klick mich"]
|
||||
[callback (lambda (b e)
|
||||
(printf "Button wurde geklickt!\n"))]))
|
||||
|
||||
; 3. Fenster sichtbar machen
|
||||
(send frame show #t)
|
||||
```
|
||||
Reference in New Issue
Block a user