What am I doing wrong?
- From: Igor Korot <ikorot01 gmail com>
- To: "gtk-list gnome org" <gtk-list gnome org>
- Subject: What am I doing wrong?
- Date: Sun, 16 Aug 2015 01:42:39 -0400
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]