Gtk::TreeViewColumn

I’m still stuck with getting a undefined sort_column_id. For a
GtkTreeViewColumn

irb(main):001:0> require ‘gtk2’
=> true
irb(main):002:0> column = Gtk::TreeViewColumn.new
=> #<Gtk::TreeViewColumn:0x29dbde8 ptr=0x2c32840>
irb(main):003:0> column.sort_column_id = 1
NoMethodError: undefined method sort_column_id=' for #<Gtk::TreeViewColumn:0x29dbde8 ptr=0x2c32840> from (irb):3 from /myscratch/ruby/bin/irb:12:in


This works on older Ruby, and “the latest greatest” Ruby + Ruby/GTK

Just on this one machine I have built the interpreter on that is back
to GTK 2.10

For reference, I am using this for my own “file selector” box, as I
need to apply my own sort. This Gtk::TreeViewColumn is my file
listing. I may not be using the best way to do it. But it seems odd it
just fails on this one build. My build base was the latest(as of
yesterday) snapshot of Ruby/GTK from Github.

Hi,

In [email protected]
“[ruby-gnome2-devel-en] Gtk::TreeViewColumn” on Thu, 9 Feb 2012
15:30:47 -0700,
grant schoep [email protected] wrote:

I’m still stuck with getting a undefined sort_column_id. For a
GtkTreeViewColumn

Short answer: I’ve commited Gtk::TreeViewColumn#sort_column_id=
support code on GTK+ 2.10 into master.

Long answer:

Ruby/GTK+ generates accessors from GObject’s property
information automatically. For example, GtkTreeViewColumn
(it’s a C level GObject) has the “sort-column-id” property:
http://developer.gnome.org/gtk/stable/GtkTreeViewColumn.html#GtkTreeViewColumn--sort-column-id

Ruby/GTK+ generates

  • Gtk::TreeViewColumn#sort_column_id
  • Gtk::TreeViewColumn#sort_column_id=
  • Gtk::TreeViewColumn#set_sort_column_id

from the property.

The above page says the “sort-column-id” property is defined
“Since 2.18”. So you don’t have
Gtk::TreeViewColumn#sort_column_id= with GTK+ 2.10.

I’ve added codes that accesse sort-column-id value by the
following functions:

Now you can use Gtk::TreeViewColumn#sort_column_id= with
GTK+ 2.10.

Thanks,

kou

In [email protected]

Sorry for the long delay on reply. I just back to this. Thanks for the
long
answer. Explains a lot. I see you did two different commits.

The first one allowed me to do

thing.set_sort_column_id(1)

But the next commit, that added the

RG_DEF_ALIAS(sort_column_id, set_sort_column_id);

Gives me the compile error:
rbgtktreeviewcolumn.c: In function ‘Init_gtk_treeviewcolumn’:
rbgtktreeviewcolumn.c:294: error: ‘sort_column_id’ undeclared (first use
in
this function)
rbgtktreeviewcolumn.c:294: error: (Each undeclared identifier is
reported
only once
rbgtktreeviewcolumn.c:294: error: for each function it appears in.)
rbgtktreeviewcolumn.c:294: error: ‘set_sort_column_id’ undeclared (first
use in this function)

Le 13 mars 2012 19:46, grant schoep [email protected] a crit :

Le 12 mars 2012 20:23, grant schoep [email protected] a crit :

support code on GTK+ 2.10 into master.

use in this function)
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2


ruby-gnome2-devel-en mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en

Hello Kouhei, Grant

I believe it was easy to fix so I did it. Could you please check ?

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] Gtk::TreeViewColumn” on Tue, 13 Mar 2012
19:23:30 +0100,
Vincent C. [email protected] wrote:

I believe it was easy to fix so I did it. Could you please check ?

Thanks!!!
It looks good for me too.


kou

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs