Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-29-2007, 05:54 PM   #1
Registered: Jan 2007
Posts: 90

Rep: Reputation: 15
How to use the GTK Iconview widget


I've been trying to understand how you use a GTK icon view widget to no avail.

I don't understand how you add icons to the view, and how you retrieve the icon that is clicked.

I use the Ruby GTK bindings, but I can't fid out my answer on their API reference.

Any guidance would be helpful.
Old 12-29-2007, 06:40 PM   #2
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
GtkIconView is like the GtkTreeView, therefore, you can create a GtkTreeModel which will have a string and a pixbuf. Then you set that as the model used by the GtkIconView and then you tell the GtkIconView that those are the "text" and "pixbuf" columns. When you add to that model, it shows up in the icon view.

You may want to read the Ruby/GTK TreeView tutorial to help understand this MVC approach to the tree view and icon view widgets:

I haven't worked much with Ruby/GTK so I can't just whip up an example. But the tree view will help as the concepts are the same as far as the data existing in the model and the icon view widget just displays that data.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GTK widget which to use? cranium2004 Programming 1 02-20-2006 01:29 PM
Gtk widget problem iali Linux - General 0 01-21-2006 12:56 AM
Getting a widget GTK programming goelvish Programming 5 08-31-2004 05:30 AM
Which GTK Widget to use? jpbarto Programming 0 11-20-2003 07:34 PM
what is a gtk-widget ? gladeiator Programming 3 10-30-2003 05:34 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration