lua-users home
lua-l archive

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


Ok great, it works now. I was missing the murgaLua to link.

1) ln -s /home/sun/Download/murgaLua/bin/Linux/murgaLua /usr/bin/murgaLua

2) vi example1.lua
fltk.fl_message("Hello Word")
print("Hello World")

3) $murgaLua example1.lua

Works great.

On Tue, Dec 21, 2010 at 17:59, Shamun toha md <shamun.toha@gmail.com> wrote:
> I have a strange problem with this fltk line 5 says:
>
> # lua simpleApp1.lua
> lua: simpleApp1.lua:1: attempt to index global 'fltk' (a nil value)
> stack traceback:
> simpleApp1.lua:1: in main chunk
> [C]: ?
> #
> $ cat simpleApp1.lua
>   do local object = fltk:Fl_Double_Window(166, 165, "My App");
>     window = object;
>     fltk:Fl_Return_Button(5, 130, 155, 30, "A return button");
>     myOptions = fltk:Fl_Check_Browser(5, 5, 155, 70, "Some choices");
>     myField = fltk:Fl_Input(5, 95, 155, 30);
>     myOptions:add("Shower and shave")
>     myOptions:add("Breakfast")
>     myOptions:add("Watch TV")
>     myOptions:add("Go to work")
>     myOptions:add("Call the plumber")
>
>     myField:callback(
>       function(myField)
>           fltk.fl_message("Changed the value to \"" .. myField:value() ..
> "\"")
>     end)
>   end
>   window:show();
>   Fl:run();
>

Well you haven't included the fltk module.
The '#' is a bit worrisome too; are you running this as root?

--
Sent from my toaster.



------------------------------

Message: 6
Date: Wed, 22 Dec 2010 09:41:21 +0100
From: ObjectiveCeeds <info@objectiveceeds.com>
Subject: Re: Luna: A scripting App for the iPad
To: Lua mailing list <lua-l@lists.lua.org>
Message-ID: <3A86D0F8-BC46-48CE-B2CB-9017821D20B1@objectiveceeds.com">3A86D0F8-BC46-48CE-B2CB-9017821D20B1@objectiveceeds.com>
Content-Type: text/plain; charset=us-ascii

1:1 translation: To have your trousers full of dung

To be a wimp.



Am 22.12.2010 um 02:06 schrieb kevin beckford:

>> What is the best English translation for "die Hosen voll haben"
>
> Please, somebody answer this question... consumed with curiosity here.
>




------------------------------

Message: 7
Date: Wed, 22 Dec 2010 09:53:51 +0100
From: ObjectiveCeeds <info@objectiveceeds.com>
Subject: Re: Luna: A scripting App for the iPad
To: Lua mailing list <lua-l@lists.lua.org>
Message-ID: <6AE51C4B-9142-4022-8F25-63F252C2AAE7@objectiveceeds.com">6AE51C4B-9142-4022-8F25-63F252C2AAE7@objectiveceeds.com>
Content-Type: text/plain; charset=us-ascii

"to shit yourself"

is another suggestion


Am 22.12.2010 um 09:41 schrieb ObjectiveCeeds:

> 1:1 translation: To have your trousers full of dung
>
> To be a wimp.
>
>
>
> Am 22.12.2010 um 02:06 schrieb kevin beckford:
>
>>> What is the best English translation for "die Hosen voll haben"
>>
>> Please, somebody answer this question... consumed with curiosity here.
>>
>
>




------------------------------

Message: 8
Date: Wed, 22 Dec 2010 04:02:29 -0500
From: Steve Litt <slitt@troubleshooters.com>
Subject: How to get one keystroke without hitting Enter?
To: lua-l@lists.lua.org
Message-ID: <201012220402.29568.slitt@troubleshooters.com">201012220402.29568.slitt@troubleshooters.com>
Content-Type: text/plain;  charset="us-ascii"

Hi all,

I want to ask the user to type a keystroke, and get that keystroke without the
user needing to press Enter. How do I do that in LUA?

In Perl you do it like this:

sub getch_unix($)
       {
       my $nodeSession = shift;
       my($GETCH_STYLE) = $nodeSession->getAttribute('getch_style');
       $GETCH_STYLE = 1 unless defined ($GETCH_STYLE);
       my($key);
       if ($GETCH_STYLE)
               {
               system "stty cbreak </dev/tty >/dev/tty 2>&1";
               }
       else
               {
               system "stty", '-icanon', 'eol', "\001";
               }

       $key = getc(STDIN);

       if ($GETCH_STYLE)
               {
               system "stty -cbreak </dev/tty >/dev/tty 2>&1";
               }
       else
               {
               system "stty", 'icanon', 'eol', '^@'; # ASCII null
               }
       return($key);
       }

For the time being I just need to do it in Linux/Unix/BSD, but it would be
nice to know how to do it in Windows too. Anyone know?

Thanks

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt




------------------------------

_______________________________________________
lua-l mailing list
lua-l@lists.lua.org
http://vlists.pepperfish.net/cgi-bin/mailman/listinfo/lua-l-lists.lua.org


End of lua-l Digest, Vol 5, Issue 113
*************************************