# Interfaces/Modules, can we actually include them? + Sortable

**URL:** <https://www.ruby-forum.com/t/interfaces-modules-can-we-actually-include-them-sortable/111879>\
**Category:** Ruby-Gnome 2\
**Created:** [August 12, 2007, 10:37pm UTC](https://www.ruby-forum.com/t/interfaces-modules-can-we-actually-include-them-sortable/111879 "2007-08-12T22:37:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [August 12, 2007, 10:37pm UTC](https://www.ruby-forum.com/t/interfaces-modules-can-we-actually-include-them-sortable/111879/1 "2007-08-12T22:37:32Z")

</div>

so, every time I try to include a ruby gtk interface (like  
TreeSortable) I get something like this:

./database\_display.rb:110:in `append\_features’: Not a subclass of  
GLib::Instantiatable (TypeError)

For instance, I have a TreeView which uses a TreeModelFilter, but I  
want to make the view sortable. How can I do that?

-Alex

* * *

This [SF.net](http://SF.net) email is sponsored by: Splunk Inc.  
Still grepping through log files to find problems? Stop.  
Now Search log events and configuration files using AJAX and a browser.  
Download your FREE copy of Splunk now \>\> [http://get.splunk.com/](http://get.splunk.com/)

---

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [August 13, 2007, 6:00pm UTC](https://www.ruby-forum.com/t/interfaces-modules-can-we-actually-include-them-sortable/111879/2 "2007-08-13T18:00:32Z")

</div>

On Sun, Aug 12, 2007 at 01:36:33PM -0700, Alex wrote:

> so, every time I try to include a ruby gtk interface (like  
> TreeSortable) I get something like this:
> 
> ./database\_display.rb:110:in `append\_features’: Not a subclass of  
> GLib::Instantiatable (TypeError)
> 
> For instance, I have a TreeView which uses a TreeModelFilter, but I  
> want to make the view sortable. How can I do that?

I’m not sure about the specific ruby error above, but in general, you  
typically wrap the TreeModelFilter in a TreeModelSort to get a filtered  
view sortable:

TreeModel (ListStore/TreeStore) → TreeModelFilter → TreeModelSort

(make sure you do the sort _after_ the filter)

-pete

* * *

This [SF.net](http://SF.net) email is sponsored by: Splunk Inc.  
Still grepping through log files to find problems? Stop.  
Now Search log events and configuration files using AJAX and a browser.  
Download your FREE copy of Splunk now \>\> [http://get.splunk.com/](http://get.splunk.com/)

---

<div class="post-metadata">

**Author:** ![alex](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/db5fbb/32.png) [@alex](https://www.ruby-forum.com/u/alex)\
**Post date:** [August 13, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/interfaces-modules-can-we-actually-include-them-sortable/111879/3 "2007-08-13T18:24:35Z")

</div>

ahh, thanks! Works like a charm  
Now, any idea how I make a treeview with a filter model a valid drag  
dest?

Right now I’ve got a hack working [with a global variable… which I  
don’t want  
to do:

[inside the destination treeview]

Gtk::Drag.dest\_set(self, Gtk::Drag::DEST\_DEFAULT\_MOTION |  
Gtk::Drag::DEST\_DEFAULT\_HIGHLIGHT,  
DND\_TAG\_TO\_AUDIO\_WORK,  
Gdk::DragContext::ACTION\_COPY)

signal\_connect(“drag-data-received”) do |w, dc, x, y, selectiondata,  
info, time|  
#do some stuff with the global variable which  
#points to the treeview which is the source, this way i can grab the  
selected  
#data… but I’d rather not work that way!  
true  
end

signal\_connect(“drag-drop”) do |w, dc, x, y, time|  
Gtk::Drag.get\_data(w, dc, dc.targets[0], time)  
true  
end

So, 2 guess there are 3 questions:

1. is there a better way to do this?  
If not:

2. how do I get the selection data out of “selectiondata” in the signal  
handler

3. how do I stop the signal from propagating [as I always get this  
message after  
I drag something:

Thanks,  
Alex

On 8/13/07, Peter J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m not sure about the specific ruby error above, but in general, you  
> This [SF.net](http://SF.net) email is sponsored by: Splunk Inc.  
> Still grepping through log files to find problems? Stop.  
> Now Search log events and configuration files using AJAX and a browser.  
> Download your FREE copy of Splunk now \>\> [http://get.splunk.com/](http://get.splunk.com/)
> 
> * * *
> 
> ruby-gnome2-devel-en mailing list  
> removed\_email\_address@domain.invalid  
> [ruby-gnome2-devel-en List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)

* * *

This [SF.net](http://SF.net) email is sponsored by: Splunk Inc.  
Still grepping through log files to find problems? Stop.  
Now Search log events and configuration files using AJAX and a browser.  
Download your FREE copy of Splunk now \>\> [http://get.splunk.com/](http://get.splunk.com/)
