Forum: Ruby-Gnome 2 TreeView + Updating list on mouse-click of header

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2007-01-06 19:30
(Received via mailing list)
Hi there,

I am using TreeView to display list store data

This works fine.


However, I want that, if you click on the header,
the list store to update and sort alphabetically.

My problem is - there seems to be no event possible
when you click on that header?

Example of my widget:



___________________________________
Name      Age     Profession
___________________________________
joe   |   51   |  C# Coder
tim   |   31   |  Python Coder
pete  |   25   |  Ruby Coder
      |        |
      |        |
      |        |



And I want to update the listings whenever
someone clicks on "Age" or "Profession"
in that header, inserted via

tree_view.insert_column(-1, 'Age',  renderer, :text => 1)
tree_view.insert_column(-1, 'Profession',  renderer, :text => 2)


--
_______________________________________________
Search for products and services at:
http://search.mail.com

Powered by Outblaze

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p...
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2007-01-19 16:30
(Received via mailing list)
Hi,

In <20070105010203.E49787AE9F@ws5-10.us4.outblaze.com>
  "[ruby-gnome2-devel-en] TreeView + Updating list on mouse-click of
header" on Fri, 05 Jan 2007 02:02:03 +0100,
  "Roebe XXX" <shevegen@linuxmail.org> wrote:

> My problem is - there seems to be no event possible
> when you click on that header?
>
> And I want to update the listings whenever
> someone clicks on "Age" or "Profession"
> in that header, inserted via
>
> tree_view.insert_column(-1, 'Age',  renderer, :text => 1)
> tree_view.insert_column(-1, 'Profession',  renderer, :text => 2)

You can't. Use the following way instead of your way:

  column = Gtk::TreeViewColumn.new('Age, renderer, :text => 1)
  column.set_sort_column_id(1)
  tree_view.append_column(column)

This sample source will help you:
  http://ruby-gnome2.cvs.sourceforge.net/ruby-gnome2...


Thanks,
--
kou

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p...
This topic is locked and can not be replied to.