What am I doing wrong?



Hi, ALL,
I'm trying to port GTK+2 app to GTK+3.

In GTK+2 I have following code:
[code]
        continuebtn = gtk_assert_dialog_add_button (dlg, "_Continue",
GTK_STOCK_YES, GTK_ASSERT_DIALOG_CONTINUE);
[/code]

I'm trying to rewrite it as follows:

[code]
        continuebtn = gtk_button_new_with_mnemonic( "_Continue" );
        GtkWidget *image = gtk_image_new_from_icon_name(
"emblem-default", GTK_ICON_SIZE_DIALOG );
        gtk_button_set_image( GTK_BUTTON( continuebtn ), image );
        gtk_dialog_add_action_widget (GTK_DIALOG (dlg), continuebtn,
GTK_ASSERT_DIALOG_CONTINUE);
[/code]

However the image is not displayed on the button.
I can't call gtk_window_set_icon_name() as GtkButton is not GtkWindow
and I'm getting a compiler error.

So how do I make a button display my named icon?

Thank you.


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