News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
strange problem with fltk ,diffrent from cmdline start or drag/drop start
Author Message
jyf1987
Member
***


Posts: 58
Group: Registered
Joined: Jun 2008
Status: Offline
Reputation: 0
Post: #1
strange problem with fltk ,diffrent from cmdline start or drag/drop start

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


Cheers
jyf
09-16-2008 12:26 AM
Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #2
RE: strange problem with fltk ,diffrent from cmdline start or drag/drop start

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

09-16-2008 04:41 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #3
RE: strange problem with fltk ,diffrent from cmdline start or drag/drop start

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.

09-16-2008 11:23 AM
Find all posts by this user Quote this message in a reply
jyf1987
Member
***


Posts: 58
Group: Registered
Joined: Jun 2008
Status: Offline
Reputation: 0
Post: #4
RE: strange problem with fltk ,diffrent from cmdline start or drag/drop start

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


Cheers
jyf
09-16-2008 01:19 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: