Re: Re : Iconview stock items
You should have read the compiler warning (and the runtime warning) : the icon_view var is not initialized when you call init_model GtkWidget *icon_view; // call of uninitialized icon_view in function init_model icon_view = gtk_icon_view_new_with_model(init_model(icon_view)); You should have written : GtkWidget *icon_view = NULL; GtkTreeModel *icon_model = NULL; icon_view = gtk_icon_view_new(); icon_model = init_model(icon_view); gtk_icon_view_set_model( GTK_ICON_VIEW(icon_view), icon_model); Le 22/01/2012 13:46, Neil Munro a écrit : I am still having issues with this, I have attached my test code for reference, the code compiles but simply segfaults upon running, it's a curious issue cos I can't see what I might be doing wrong. On 18 January 2012 13:21, Nicolas Soubeiran wrote: For the widget you should pass the iconview where you want to display the stock. The "detail" parameter is for the theme engine, if you do not understand, it probably means that NULL should be OK. I recommend an update of Gtk to you. The 2.6 version you seem to use is a>5 years old version of GTK2 (cf the link you send). The current version is available on the gtk homepage. The Gtk-documentation has really been improved since. 2012/1/17 Neil Munro: On 17 January 2012 18:20, Nicolas SOUBEIRAN wrote: Le 17/01/2012 02:02, Neil Munro a écrit : On 16 January 2012 19:01, Nicolas SOUBEIRAN wrote: Use gtk_widget_render_icon_pixbuf If you need a custom size, you may look after gtk_icon_size_register Is this a gtk3 function as I cannot find it as a function of a gtk2 widget: http://www.gtk.org/api/2.6/gtk/GtkWidget.html It is a gtk3 function the gtk2 equivalent is gtk_widget_render_icon : http://www.gtk.org/api/2.6/gtk/GtkWidget.html#gtk-widget-render-icon Excellent, however I am still stuck, if this function returns a pixbuf and I pass it the stock_id and size I want, what widget do I need to pass to it? Also what purpose does the detail parameter serve? I thought I was coming to understand gtk+ until now, I am sure that what I am trying to achieve is a trivial matter (I am ultimately creating a iconview to essentially be a prettier way to navigate about a notebook) but for some reason I am just getting stuck. Again if anyone could offer any help I would be really grateful ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Re : Iconview stock items
I am still having issues with this, I have attached my test code for reference, the code compiles but simply segfaults upon running, it's a curious issue cos I can't see what I might be doing wrong. On 18 January 2012 13:21, Nicolas Soubeiran wrote: > For the widget you should pass the iconview where you want to display the > stock. > The "detail" parameter is for the theme engine, if you do not > understand, it probably means that NULL should be OK. > I recommend an update of Gtk to you. The 2.6 version you seem to use > is a >5 years old version of GTK2 (cf the link you send). The current > version is available on the gtk homepage. The Gtk-documentation has > really been improved since. > > > > 2012/1/17 Neil Munro : >> On 17 January 2012 18:20, Nicolas SOUBEIRAN >> wrote: >>> Le 17/01/2012 02:02, Neil Munro a écrit : >>> On 16 January 2012 19:01, Nicolas SOUBEIRAN wrote: > > Use gtk_widget_render_icon_pixbuf > If you need a custom size, you may look after gtk_icon_size_register > > Is this a gtk3 function as I cannot find it as a function of a gtk2 widget: http://www.gtk.org/api/2.6/gtk/GtkWidget.html >>> It is a gtk3 function the gtk2 equivalent is >>> >>> gtk_widget_render_icon >>> >>> : http://www.gtk.org/api/2.6/gtk/GtkWidget.html#gtk-widget-render-icon >>> >> >> Excellent, however I am still stuck, if this function returns a pixbuf >> and I pass it the stock_id and size I want, what widget do I need to >> pass to it? Also what purpose does the detail parameter serve? I >> thought I was coming to understand gtk+ until now, I am sure that what >> I am trying to achieve is a trivial matter (I am ultimately creating a >> iconview to essentially be a prettier way to navigate about a >> notebook) but for some reason I am just getting stuck. >> >> Again if anyone could offer any help I would be really grateful ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Re : Iconview stock items
For the widget you should pass the iconview where you want to display the stock. The "detail" parameter is for the theme engine, if you do not understand, it probably means that NULL should be OK. I recommend an update of Gtk to you. The 2.6 version you seem to use is a >5 years old version of GTK2 (cf the link you send). The current version is available on the gtk homepage. The Gtk-documentation has really been improved since. 2012/1/17 Neil Munro : > On 17 January 2012 18:20, Nicolas SOUBEIRAN > wrote: >> Le 17/01/2012 02:02, Neil Munro a écrit : >> >>> On 16 January 2012 19:01, Nicolas SOUBEIRAN >>> wrote: Use gtk_widget_render_icon_pixbuf If you need a custom size, you may look after gtk_icon_size_register >>> Is this a gtk3 function as I cannot find it as a function of a gtk2 >>> widget: http://www.gtk.org/api/2.6/gtk/GtkWidget.html >>> >> It is a gtk3 function the gtk2 equivalent is >> >> gtk_widget_render_icon >> >> : http://www.gtk.org/api/2.6/gtk/GtkWidget.html#gtk-widget-render-icon >> > > Excellent, however I am still stuck, if this function returns a pixbuf > and I pass it the stock_id and size I want, what widget do I need to > pass to it? Also what purpose does the detail parameter serve? I > thought I was coming to understand gtk+ until now, I am sure that what > I am trying to achieve is a trivial matter (I am ultimately creating a > iconview to essentially be a prettier way to navigate about a > notebook) but for some reason I am just getting stuck. > > Again if anyone could offer any help I would be really grateful ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Re : Iconview stock items
On 17 January 2012 18:20, Nicolas SOUBEIRAN wrote: > Le 17/01/2012 02:02, Neil Munro a écrit : > >> On 16 January 2012 19:01, Nicolas SOUBEIRAN >> wrote: >>> >>> Use gtk_widget_render_icon_pixbuf >>> If you need a custom size, you may look after gtk_icon_size_register >>> >>> >> Is this a gtk3 function as I cannot find it as a function of a gtk2 >> widget: http://www.gtk.org/api/2.6/gtk/GtkWidget.html >> > It is a gtk3 function the gtk2 equivalent is > > gtk_widget_render_icon > > : http://www.gtk.org/api/2.6/gtk/GtkWidget.html#gtk-widget-render-icon > Excellent, however I am still stuck, if this function returns a pixbuf and I pass it the stock_id and size I want, what widget do I need to pass to it? Also what purpose does the detail parameter serve? I thought I was coming to understand gtk+ until now, I am sure that what I am trying to achieve is a trivial matter (I am ultimately creating a iconview to essentially be a prettier way to navigate about a notebook) but for some reason I am just getting stuck. Again if anyone could offer any help I would be really grateful ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Re : Iconview stock items
Le 17/01/2012 02:02, Neil Munro a écrit : On 16 January 2012 19:01, Nicolas SOUBEIRAN wrote: Use gtk_widget_render_icon_pixbuf If you need a custom size, you may look after gtk_icon_size_register Is this a gtk3 function as I cannot find it as a function of a gtk2 widget: http://www.gtk.org/api/2.6/gtk/GtkWidget.html It is a gtk3 function the gtk2 equivalent is gtk_widget_render_icon : http://www.gtk.org/api/2.6/gtk/GtkWidget.html#gtk-widget-render-icon ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Re : Iconview stock items
On 16 January 2012 19:01, Nicolas SOUBEIRAN wrote: > Use gtk_widget_render_icon_pixbuf > If you need a custom size, you may look after gtk_icon_size_register > > Is this a gtk3 function as I cannot find it as a function of a gtk2 widget: http://www.gtk.org/api/2.6/gtk/GtkWidget.html ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re : Iconview stock items
Use gtk_widget_render_icon_pixbuf If you need a custom size, you may look after gtk_icon_size_register ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Iconview stock items
I am working with an icon view and am trying to load stock items into the gdk_pixbuf_new_from_file( ) but it's not working, I assume that is perhaps because I am using the function wrong, is there a way to do what I am trying to do? I am following the tutorial here: http://zetcode.com/tutorials/gtktutorial/gtkwidgetsII/ and simply trying to swap out custom images for stock ones to use in my real application once I have understood the principles correctly. If anyone knows where I may be going wrong I would appreciate some pointers, I know it's a widget like a treeview so requires a model and that the model has a label and an image but beyond that without getting the examples working I don't know how much I am understanding is accurate or not. Thanks, Neil ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list