29 Sep 2010 22:31:57 UTC
- Distribution: Gtk2-Ex-TreeModelFilter-DragDest
- Module version: 3
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (1186 / 2 / 1)
- KwaliteeBus factor: 1
- 87.50% Coverage
- License: open_source
- Perl: v5.8.0
- Activity24 month
- Download (31.99KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionKRYDE Kevin Rydeand 1 contributors
- Kevin Ryde
Gtk2::Ex::TreeModelFilter::Draggable -- draggable subclass of TreeModelFilter
use Gtk2::Ex::TreeModelFilter::Draggable; my $filter = Gtk2::Ex::TreeModelFilter::Draggable->new ($child_model);
Gtk2::Ex::TreeModelFilter::Draggableis a subclass of
Glib::Object Gtk2::TreeModelFilter Gtk2::Ex::TreeModelFilter::Draggable
and adds the interface
Gtk2::TreeModelFilterto add a
Gtk2::TreeDragDestinterface, making rows draggable when displayed for instance in a
Gtk2::TreeView. Everything else in TreeModelFilter is unchanged. Basically to get a draggable filtered model use
wherever you would have had
Gtk2::TreeModelFilter->new. See Gtk2::Ex::TreeModelFilter::DragDest for the drop details, and for getting DragDest on some other subclass or sub-sub-class of TreeModelFilter.
Gtk2::Ex::TreeModelFilter::Draggable->new ($child_model, $virtual_root)
Create and return a new TreeModelFilter::Draggable. The parameters are like the core
$child_modelis the underlying model to present (any object implementing
Gtk2:TreeModel), and the optional
Gtk2::TreePathwhich is a subtree of
If you subclass further from TreeModelFilter::Draggable using
Glib::Object::Subclassthen note that module will fiddle with your
Glib::Object::new()ahead of the
newabove. Often this is a good thing if you've got additional properties in your subclass you want to set from
new; but you can unfiddle or elevate TreeModelFilter::Draggable if you want the
newabove (it knows to use the
$classargument when run from a subclass, unlike the various C code class-specific
As of Gtk 2.12 the core
Gtk2::TreeModelFilteris a TreeDragSource, but not a TreeDragDest. Perhaps by the time you read this that will have changed. TreeModelFilter::Draggable is setup to watch out for that and omit its own DragDest, on the assumption the core will be equal or better. You can decide whether this is prudently forward-looking, or naively optimistic.
Copyright 2008, 2009, 2010 Kevin Ryde
Gtk2-Ex-TreeModelFilter-DragDest is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Gtk2-Ex-TreeModelFilter-DragDest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Gtk2-Ex-TreeModelFilter-DragDest. If not, see http://www.gnu.org/licenses/.
Module Install Instructions
To install Gtk2::Ex::TreeModelFilter::DragDest, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Gtk2::Ex::TreeModelFilter::DragDest
For more information on module installation, please visit the detailed CPAN module installation guide.