lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


nvm: it was the iup.MainLoop() that was messing me up

Merick wrote:
I'm trying to have an open file dialog load a text file into a multiline, but although the text does get loaded it doesn't show up in my editor::

function item_open:action()
   open_dlg:popup (iup.CENTER, iup.CENTER)
   iup.MainLoop()
   if open_dlg.status == "0" and open_dlg.fileexist == "YES" then
       local file = io.open(open_dlg.value, "r")
       local text = file:read("*a")
       edit_box.value = text
       file:close()
   end
   return iup.DEFAULT
end