Re: using personal icons in the GtkScaleButton



Ok, but how should I to do this?

I tried this:

    gtk_icon_factory_add(iconFactory, "my-icon",
gtk_icon_set_new_from_pixbuf(gdk_pixbuf_new_from_file("icon.jpg",
&error)));

    if(error)
    {
        g_print("\n%s", error->message);
    }

    scaleButton3 = gtk_scale_button_new(GTK_ICON_SIZE_LARGE_TOOLBAR,
0, 1, 1, "my-icon");;

But I have Segmentation fault when use "my-icon" at the
gtk_scale_button_new(). If I use NULL it work right. I have substitute
gtk_scale_button_new for gtk_button_new_from_stock("my-icon") and
works fine, but don't show my image, just show the label "my-icon".

What I'm doing wrong?

2010/5/26 Tristan Van Berkom <tvb gnome org>:
> On Wed, May 26, 2010 at 9:24 PM, John Williams <asb1231 gmail com> wrote:
>> Anyone?
>>
>> 2010/5/25 John Williams <asb1231 gmail com>:
>>> Is possible use images from file in the GtkScaleButton as the images
>>> set by gtk_scale_button_set_icons?
>>>
>
> You should be able to just use the names of the icons
> defined by a GtkIconFactory you create.
>
> Although from reading those docs I'm not sure if the name strings
> will be searched from the icon theme or from the stock.
>
> Cheers,
>         -Tristan
>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]