键盘助记符不起作用
Keyboard mnemonics not working
在下面的代码中,我期望 Ctrl + F 到 hide/show GtkExpander
的 child 但它没有发生。
#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;
}
感谢任何帮助。
根据 unwind 的建议,我仔细检查了默认修饰符
它是 Alt + F 而不是 Ctrl + F。问题解决了。
在下面的代码中,我期望 Ctrl + F 到 hide/show GtkExpander
的 child 但它没有发生。
#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;
}
感谢任何帮助。
根据 unwind 的建议,我仔细检查了默认修饰符 它是 Alt + F 而不是 Ctrl + F。问题解决了。