Mercurial Hosting > luan
changeset 1969:c7585a196f32 default tip
is_visible
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 10 Jun 2025 20:46:25 -0600 |
parents | 2ea6ab849e1a |
children | |
files | src/luan/modules/swing/Awt_container.luan src/luan/modules/swing/Awt_window.luan src/luan/modules/swing/Component.luan |
diffstat | 3 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/luan/modules/swing/Awt_container.luan Tue Jun 10 19:36:11 2025 -0600 +++ b/src/luan/modules/swing/Awt_container.luan Tue Jun 10 20:46:25 2025 -0600 @@ -33,7 +33,7 @@ if key == "foreground_color" then return jcomponent.getForeground() end - if key == "visible" then + if key == "is_visible" then return jcomponent.isVisible() end if key == "size" then
--- a/src/luan/modules/swing/Awt_window.luan Tue Jun 10 19:36:11 2025 -0600 +++ b/src/luan/modules/swing/Awt_window.luan Tue Jun 10 20:46:25 2025 -0600 @@ -27,7 +27,7 @@ local rtn = super__new_index(window,key,value) if rtn ~= fail then return end local jwindow = window.java - if key == "visible" then + if key == "is_visible" then jwindow.setVisible(value) return end
--- a/src/luan/modules/swing/Component.luan Tue Jun 10 19:36:11 2025 -0600 +++ b/src/luan/modules/swing/Component.luan Tue Jun 10 20:46:25 2025 -0600 @@ -42,16 +42,17 @@ function Component.__new_index(component,key,value) local rtn = super__new_index(component,key,value) if rtn ~= fail then return end + local jcomponent = component.java if key == "foreground_color" then - component.java.setForeground(value) + jcomponent.setForeground(value) return end if key == "border" then - component.java.setBorder(value) + jcomponent.setBorder(value) return end - if key == "visible" then - component.java.setVisible(value) + if key == "is_visible" then + jcomponent.setVisible(value) return end return fail @@ -77,8 +78,8 @@ if foreground_color~=nil then jcomponent.setForeground(foreground_color) end local background_color = remove(props,"background_color") if background_color~=nil then jcomponent.setBackground(background_color) end - local visible = remove(props,"visible") - if visible~=nil then jcomponent.setVisible(visible) end + local is_visible = remove(props,"is_visible") + if is_visible~=nil then jcomponent.setVisible(is_visible) end local alignment_x = remove(props,"alignment_x") if alignment_x~=nil then alignment_x = alignments[alignment_x] or error "invalid alignment_x"