u2musicmike


Group: Members
Posts: 149
Joined: April 2006 |
 |
Posted: Feb. 12 2007,03:39 |
 |
Can somebody tell me why this doesn't work?
Code Sample | #!/bin/lua
-- hello.cxx from the FLTK tutorial in Lua.
-- Create a window
w = fltk:Fl_Window(300,180,"Hello")
-- and a box with the "Hello, World!" string in it:
box = fltk:Fl_Box(20,40,260,100,"Hello, World!")
-- Next, we set the type of box and the size, font, and style of the label:
box:box(fltk.FL_THIN_UP_BOX) box:labelsize(36) box:labelfont(FL_COURIER_BOLD) box:labeltype(FL_SHADOW_LABEL)
-- Of course, that's the C++ way. The Lua way:
-- box = Box{20,40,260,100,"Hello, World!"; -- box=Boxtype.up, labelsize=36, labelfont=Font.bold+Font.italic, -- labeltype=Labeltype.shadow}
-- Finally, we show the window and enter the FLTK event loop:
-- w:end_layout() -- ends the layout of the window w:show()
-- The resulting program will display the window below. You can quit -- the program by closing the window or pressing the ESCape key. |
|