comparison src/luan/modules/swing/Abstract_button.luan @ 1863:928e73bfe7ea

swing work
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 31 Mar 2025 13:46:47 -0600
parents
children 03209933fe4a
comparison
equal deleted inserted replaced
1862:d59d4ef5ca46 1863:928e73bfe7ea
1 local Luan = require "luan:Luan.luan"
2 local error = Luan.error
3 local Utils = require "luan:swing/Utils.luan"
4 local fail = Utils.fail or error()
5 require "java"
6
7
8 local Abstract_button = {}
9
10 function Abstract_button.__index(abstract_button,key)
11 if key == "text" then
12 return abstract_button.java.getText()
13 end
14 return fail
15 end
16
17 function Abstract_button.__new_index(abstract_button,key,value)
18 if key == "text" then
19 abstract_button.java.setText(value)
20 return
21 end
22 return fail
23 end
24
25 return Abstract_button