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 
Using callbacks to move objects on the screen
Author Message
widged
Junior Member
**


Posts: 35
Group: Registered
Joined: May 2007
Status: Offline
Reputation: 0
Post: #1
RE: Using callbacks to move objects on the screen

JohnMurga Wrote:
OK, I'll have to think about how to implement the "handle" functionality.


A quick hack, this will react to the button being pressed down as well as up. These fltk constants don't seem to be understood by murgalua, so the number between brackets need to be used.

Code:
but = fltk:Fl_Button(10,wh-30,80,22,"a button");
but:when(1);
--[[
    FL_WHEN_NEVER             {0;}
    FL_WHEN_CHANGED           {1;}
    FL_WHEN_RELEASE           {4;}
    FL_WHEN_RELEASE_ALWAYS    {6;}
    FL_WHEN_ENTER_KEY         {8;}
    FL_WHEN_ENTER_KEY_ALWAYS  {10;}
    FL_WHEN_ENTER_KEY_CHANGED {11;}
    FL_WHEN_NOT_CHANGED       {2;}
]]
but:callback(function(self)
  fltk.fl_message("changed")
end)

06-05-2007 11:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
RE: Using callbacks to move objects on the screen - widged - 06-05-2007 11:42 PM

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

Forum Jump: