Article Preview
Buy Now
COLUMN
Drag-n-Drop
Supporting dragging and dropping in your app
Issue: 7.6 (September/October 2009)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 30,918
Starting Page Number: 40
Article Number: 7611
Resource File(s):
7611.zip Updated: 2009-09-01 11:35:03
Related Link(s): None
Excerpt of article text...
The ability to drag data around in applications -- and even between applications -- is so basic it's easy forget how much work goes on behind the scenes to make such magic happen. REALbasic supports some drag-and-drop automatically, such as dragging text within text fields. But if you want your app to support more: accepting files dropped onto your app's icon or windows, or moving text, pictures, or custom data between interface elements in your program, you'll have to do some extra work. If you're new to programming or REALbasic how you do some of that may not be obvious, so today we're going to explore how to add drag-and-drop to your app.
The basic steps involved in supporting drag and drop are simple. First you prepare an interface element by setting it up to allow drops of a certain kind (i.e., text or files). Then you add code to do something with the drop (what that is, exactly, varies with the kind of data dropped and the abilities of your specific app).
If you are creating the drag, not just receiving a drop, you'll need to prepare the drag first.
...End of Excerpt. Please purchase the magazine to read the full article.