Murga-Projects Forums

Full Version: Using callbacks to move objects on the screen
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
to know if the mouse is up or down:

Code:
but = fltk:Fl_Button(10,wh-30,80,22,"a button");
but:when(1);
but:callback(function(self)
  message = "down"
  if (Fl:event() == 2) then message ="up" end
  out:value(message)
end)

  out=fltk:Fl_Output(95,wh-30,70,22)


More information on FLTK Events. As the above shows, what is written in the fltk doc as Fl::event() is written Fl:event() in murgalua.

Pages: 1 2
Reference URL's