Mercurial Hosting > luan
diff src/luan/modules/swing/Button.luan @ 1882:f8ca4a147ac9
swing
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 07 Apr 2025 22:34:12 -0600 |
parents | c7c7d62f8c62 |
children | d1708f8d4923 |
line wrap: on
line diff
--- a/src/luan/modules/swing/Button.luan Mon Apr 07 21:14:53 2025 -0600 +++ b/src/luan/modules/swing/Button.luan Mon Apr 07 22:34:12 2025 -0600 @@ -1,18 +1,22 @@ local Luan = require "luan:Luan.luan" local error = Luan.error +local set_metatable = Luan.set_metatable or error() local Abstract_button = require "luan:swing/Abstract_button.luan" local super__index = Abstract_button.__index or error() local super__new_index = Abstract_button.__new_index or error() -local super_new = Abstract_button.new or error() +local super_construct = Abstract_button.construct or error() +local super_mt = Abstract_button.mt or error() require "java" local JButton = require "java:javax.swing.JButton" local Button = {} -function Button.new(button) +function Button.new(props) + props = props or {} local button = { java = JButton.new() } - super_new(button) + super_construct(button,props) + set_metatable(button,super_mt) return button end