gtk+ : GtkFileChooserDialog 隐藏一些小部件
我对 GtkFileChooserDialog 有一个小问题。
我想隐藏收藏夹面板(左侧的小部件)。
所以我开始获取GtkFileChooserDialog的GtkVBox, 现在我想找回它的孩子并击中它, 但我没有发现这是孩子们。
这是我的代码:
my_dialog = gtk_file_chooser_dialog_new("Hop", NULL, GTK_FILE_CHOOSER_ACTION_OPEN,GTK_STOCK_CANCEL);
button = gtk_file_chooser_button_new_with_dialog(my_dialog);
children_dial = gtk_container_get_children(GTK_CONTAINER(my_dialog));
v_dial = GTK_VBOX(children_dial->data);
v_children = gtk_container_get_children(GTK_CONTAINER(v_dial));
所以如果有人有想法,
谢谢。
I have a little problem with the GtkFileChooserDialog.
I Want to hide the favoris panel (widget on the left).
So I start to get the GtkVBox of the GtkFileChooserDialog,
and now I Want to retrive it's child and hite it,
but I don't find it's children.
Here is my code :
my_dialog = gtk_file_chooser_dialog_new("Hop", NULL, GTK_FILE_CHOOSER_ACTION_OPEN,GTK_STOCK_CANCEL);
button = gtk_file_chooser_button_new_with_dialog(my_dialog);
children_dial = gtk_container_get_children(GTK_CONTAINER(my_dialog));
v_dial = GTK_VBOX(children_dial->data);
v_children = gtk_container_get_children(GTK_CONTAINER(v_dial));
So if anyone has an idea,
thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GtkFileChooserDialog
和GtkFileChooserWidget
的子级是“内部”子级,这意味着您无法像这样检索它们。您不应该弄乱它们,因为它们在未来版本中可能会以不同的方式实现。但是,您可以使用gtk_container_forall()
。
为什么要隐藏收藏夹面板?除非您有充分的理由,否则仅仅因为您不喜欢左侧的面板就更改用户期望的标准文件对话框是糟糕的用户界面设计。
The children of the
GtkFileChooserDialog
andGtkFileChooserWidget
are "internal" children which means you can't retrieve them like that. You aren't supposed to mess with them, since they may be implemented differently in a future version. However, you can access them withgtk_container_forall()
.Why do you want to hide the favorites panel? Unless you have a really good reason, it is bad user interface design to change the standard file dialog that users expect, just because you don't like the panel on the left.