Hello,
i'm not sure if its really a bug or if i'm doing it wrong.
It looks like the Groupbox doesn't trigger the events of its child widgets.
Below the code of imgconv.wlua
from the examples, i've just modified it to add a groupbox around the button.
local ui = require "ui"
local win = ui.Window("Picture conversion example", 512, 380)
win:status("")
local img = ui.Picture(win, "")
img:load("LuaRT.png")
img:center()
local grp = ui.Groupbox(win, "Button")
grp.x = 8
grp.y = img.y + img.height + 30
grp.width = win.width - 16
grp.height = 50
local button = ui.Button(grp, "Save picture to...")
button:center()
-- button.y = img.y + img.height + 30
function button:onClick()
local file = ui.savedialog("Save picture as...", false, "All files (*.*)|*.*|PNG image files (*.png)|*.png|JPEG image files (*.jpg)|*.jpg|Bitmap image files (*.bmp)|*.bmp|GIF image files (*.gif)|*.gif|ICO image files (*.ico)|*.ico|TIFF image files (*.tiff)|*.tiff")
if file ~= nil and (not file.exists or (file.exists and ui.confirm(file.fullpath.." already exists. Continue and overwrite its content ?") == "yes")) then
if img:save(file) then
win:status("Picture saved as "..file.fullpath)
end
end
end
win:center()
win:show()
repeat
ui.update()
until win.visible == false
If the button get a parent of ui.Window
or ui.Tab
, btw. ui.TabItem
it works as expected.
Using the latest version of LuaRT (0.9.7).
Greetings,
Steven