Murga-Projects Forums
strange problem with fltk ,diffrent from cmdline start or drag/drop start - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: strange problem with fltk ,diffrent from cmdline start or drag/drop start (/showthread.php?tid=343)


strange problem with fltk ,diffrent from cmdline start or drag/drop start - jyf1987 - 09-16-2008 12:26 AM

it is very stangely that i run the same code with diffrent start method
and one work well while the other do not
the code is

Code:
function quit_callback(msg)
   if fltk.fl_choice("Are you sure you want to EXIT ?", "No", "Yes", nil) >= 1 then
      w:hide()
      os.exit()
   end
end

ww,wh,wt=300,280,"Simple IRC Client - Powered by jyf1987"

w= fltk:Fl_Window(ww,wh,wt)
w:callback(quit_callback)

msgout= fltk:Fl_Browser(5, 5, 290, 240)


msgin= fltk:Fl_Input(5, 250, 290, 25)
msgin:callback(
function()
  msgout:add(msgin:value())
  msgout:bottomline(msgout:size())
  msgin:value("")
end
)
msgin:when(fltk.FL_WHEN_ENTER_KEY_ALWAYS)
w:show()

msgout:add("hello")
msgout:bottomline(msgout:size())

Fl:run()



when i run it from cmdline ,i juse type murgalua.exe 2chat.lua
it works well
but when i try to drag the code file 2chat.lua and drop it on murgalua.exe
it dont work

so what's the problem

i just want to test if the code ("msgout:add("hello")") run in the fltk loop


RE: strange problem with fltk ,diffrent from cmdline start or drag/drop start - JohnMurga - 09-16-2008 04:41 AM

Hi,

This is surprising ... Not that I support the behavior ...

But I will look into it, as I thought that just invoked with parameters.

I support two ways of invoking the script :

* murgaLua <scriptName>
* Or compile the script into an executable and run that.

Cheers
JohnM


RE: strange problem with fltk ,diffrent from cmdline start or drag/drop start - mikshaw - 09-16-2008 11:23 AM

In my limited experience with Windows, I set up an association of *.lua files to murgaLua, and opened them with a double-click on the file name in Explorer. I can't recall ever trying a drag-drop onto the murgaLua.exe icon, since I tend to not like icons or consider them the least bit useful.


RE: strange problem with fltk ,diffrent from cmdline start or drag/drop start - jyf1987 - 09-16-2008 01:19 PM

oh,yes,when i compile lua code to the execute file ,it work well
and i want to make green software so i wont set up an association