键盘助记符不起作用

时间:2015-05-08 09:11:26

标签: c gtk

在下面的代码中,我希望 Ctrl + F 隐藏/显示GtkExpander的子项,但它没有发生。

#include <gtk/gtk.h>
int main (int argc,char *argv[])
{

    GtkWidget *window, *expander, *label;
    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (window), "Expander");
    gtk_container_set_border_width (GTK_CONTAINER (window), 10);
    gtk_widget_set_size_request (window, 200, 100);

    expander = gtk_expander_new_with_mnemonic ("Click Me _For More!");
    label = gtk_label_new ("Hide me or show me,\nthat is your choice.");
    gtk_container_add (GTK_CONTAINER (expander), label);

    gtk_expander_set_expanded (GTK_EXPANDER (expander), TRUE);

    gtk_container_add (GTK_CONTAINER (window), expander);

    gtk_widget_show_all (window);
    gtk_main ();
    return 0;
}

任何帮助表示感谢。

1 个答案:

答案 0 :(得分:0)

根据放松的建议,我仔细检查了默认修饰符 它是 Alt + F 而不是 Ctrl + F 。问题解决了。