More example stuff.

Signed-off-by: Hans Dijkema <hans@dijkewijk.nl>
This commit is contained in:
2025-11-12 16:17:13 +01:00
parent 51c8ef5aa1
commit d7f9e3b7ed
3 changed files with 76 additions and 5 deletions

View File

@@ -93,7 +93,11 @@
(counter-thread #f)
)
(send this set-menu! test-menu)
(send this connect-menu! 'm-quit (λ () (send this close)))
(send this connect-menu! 'm-quit
(λ ()
(set! go-on-counter #f)
(send this close))
)
(let ((make-menu-executor (λ (item elem string count)
(send this connect-menu! item
(λ ()
@@ -113,13 +117,24 @@
(when go-on-counter
(set! c-counter (+ c-counter 1))
(send div-counter set-inner-html (format "Count = ~a" c-counter))
(when (and (> c-counter 0) (<= c-counter 1))
(send div-counter set-style! (css-style '((background white)))))
(when (and (> c-counter 100) (<= c-counter 101))
(send div-counter set-style! (css-style '((background green) (color white)))))
(when (and (> c-counter 200) (<= c-counter 201))
(send div-counter set-style! (string->css-style "background: yellow; font-size: 120%;")))
(when (and (> c-counter 300) (<= c-counter 301))
(send div-counter set-style! (string->css-style "color: white; background: orange; font-size: 130%;")))
(when (and (> c-counter 400) (<= c-counter 401))
(send div-counter set-style! (string->css-style "color: white; background: red; font-size: 150%; font-weight: bold;")))
(sleep 0.01)
(f)))))
(set! go-on-counter #t)
(f)))))))
(send this connect-menu! 'm-stop
(λ ()
(set! go-on-counter #f)))
(set! go-on-counter #f)
(set! c-counter 0)))
)
)

54
example1/styles.css Normal file
View File

@@ -0,0 +1,54 @@
body {
font-family: Arial;
font-size: 11pt;
}
h1 {
color: #303030;
}
h1:hover {
color: #606060;
}
a {
text-decoration: none;
}
button.btn-1 {
background: #1adb4e;
border: 1px solid black;
padding: 1em;
}
button.btn-2 {
color: white;
background: #3e5c46;
border: 1px solid green;
padding: 1em;
margin-left: 1em;
}
button.btn-2 a {
color: white;
}
table {
margin: 1em;
border: 1px solid black;
border-collapse: collapse;
}
table td {
border: 1px solid #909090;
padding: 0.5em;
width: 70%;
}
table th {
border-collapse: collapse;
border: 1px solid #909090;
padding: 0.5em;
width: 30%;
}