lua-users home
lua-l archive

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


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.