Supporting dragging and dropping in your app
Issue: 7.6 (September/October 2009)
Author: Marc Zeedar editor-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 24,572
Starting Page Number: 40
RBD Number: 7611
7611.zip Updated: Tuesday, September 1, 2009 at 12:59 PM
Related Link(s): None
Known Limitations: 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.
Article copyrighted by REALbasic Developer magazine. All rights reserved.