annotate src/luan/modules/swing/Swing.luan @ 1735:4b56eff90040 default tip

add hosting.html
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 02 Oct 2022 17:32:00 -0600
parents 915cb538e2a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1616
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
1 local Luan = require "luan:Luan.luan"
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
2 local error = Luan.error
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
3 local Thread = require "luan:Thread.luan"
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
4 local safe = Thread.safe or error()
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
5 require "java"
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6 local SwingLuan = require "java:luan.modules.swing.SwingLuan"
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
8
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 local Swing = {}
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11 function Swing.run(fn)
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 fn = safe(fn)
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
13 SwingLuan.run(fn)
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
14 end
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
15
915cb538e2a3 start swing
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
16 return Swing