Tk::IDElayout::DropBox - IDElayout Helper class for Drag Drop Operations
This is a simple Singleton class that implements a simple DropBox to help in drag-drop operations for the Tk::IDElayout and Tk::IDEtabFrame widgets. This dropbox is similar to a global hash for temporary storage of objects that are dragged, so that the drop location can pickup the dropped object perform any processing.
It only makes sense to have one instance of this object per process, so this class implements the Singleton design pattern to keep only one instance. Therefore, there is no new method, only an instance method used to gain access to the one instance of the class.
Internal method used to create the object.
Access the single instance of this class
Usage:
my $dropbox = Tk::IDElayout::DropBox->instance;
Set a location in the dropbox to a value. This is similar to setting the value of a hash
$DropBox->set($key, $value) where: $key: Location (i.e. key) in the dropbox to store $value: Data to store in the dropbox.
Get the data in a location in the dropbox. This is similar to getting the value of a hash
my $value = $DropBox->get($key); where: $key: Location (i.e. key) in the dropbox to store $value: Data to retreived in the dropbox.
Delete the data in a location in the dropbox. This is similar to deleting the value of a hash.
my $value = $DropBox->delete($key); where: $key: Location (i.e. key) in the dropbox to store $value: Data deleted in the dropbox.
To install Tk::IDElayout, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tk::IDElayout
CPAN shell
perl -MCPAN -e shell install Tk::IDElayout
For more information on module installation, please visit the detailed CPAN module installation guide.