|
|
| TopPage > GTK+/Gladeの使い方 > GTK+/Gladeの使い方[03] |
| アイコン、画像の表示 |
[hogeuser]$ ./configure --prefix=/home/hogeuser/tamesi_inst/ |
tamesi_inst +--bin +--share : +--sample_icon_test ここは、プログラム名と同じ名前になる : : +--pixmaps |
| ボタンの振る舞いで他のWidgetの制御する記述 |
![]() |
![]() |
void
on_button1_clicked (GtkButton *button,
gpointer user_data)
{
}
|
void
on_button1_clicked (GtkButton *button,
gpointer user_data)
{
// get pointer entry1 to button
GtkEntry *entry1 = (GtkEntry*)lookup_widget ( GTK_WIDGET(button), "entry1") ;
// set new text to entry1
gtk_entry_set_text (GTK_ENTRY (entry1), _("hello entry1"));
// get pointer entry1 to button
GtkEntry *entry2 = (GtkEntry*)lookup_widget ( GTK_WIDGET(button), "entry2") ;
// set new text to entry2
gtk_entry_set_text (GTK_ENTRY (entry2), _("hello Entry2"));
}
|
| ComboBoxの初期表示の設定 |
combobox1 = gtk_combo_box_new_text ();
gtk_widget_show (combobox1);
........
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox1), _("abc"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox2), _("def"));
gtk_combo_box_append_text (GTK_COMBO_BOX (combobox3), _("ghi"));
........
gtk_combo_box_set_active(GTK_COMBO_BOX (combobox1), 0);
↑追記する内容。0は、indexの最初を示す。2番目を初期表示させたい場合は、ここを1にする。
|
| TopPage > GTK+/Gladeの使い方 > GTK+/Gladeの使い方[03] |