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

Is it possible to have a drag and drop functionality? I can see an example at fltk cheat sheets - Draggable boxes

How to detect and react to these events from within murgaLua?

Code:
case FL_PUSH:
    offset[0] = x() - Fl::event_x();    // save where user clicked for dragging
    offset[1] = y() - Fl::event_y();
    return(1);
case FL_RELEASE:
    return(1);
case FL_DRAG:
    position(offset[0]+Fl::event_x(), offset[1]+Fl::event_y());     // handle dragging
    G_win->redraw();
    return(1);

This post was last modified: 05-26-2007 04:24 AM by widged.

05-26-2007 04:20 AM
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 - 05-26-2007 04:20 AM

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

Forum Jump: