请教一个比较辣手的事情,我用的gtk_file_chooser_dialog_new
请教一个比较辣手的事情,我用的gtk_file_chooser_dialog_new建一个之后移植到机器上后发现界面拥挤,我想改界面大小,但是不成功,想请问有没有好的方法,有例子吗?
save_draft (DrivelClient *dc)
{
GtkWidget *dialog;
GtkFileFilter *filter;
gboolean retval;
debug ("save_draft()");
dialog = gtk_file_chooser_dialog_new (_("Drivel - Save Draft"),
GTK_WINDOW (dc->current_window),
GTK_FILE_CHOOSER_ACTION_SAVE,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
// Add filters for all XML files all XML files which appear to be Drivel Drafts
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("All XML Files"));
gtk_file_filter_add_mime_type (filter, "text/xml");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
filter = gtk_file_filter_new ();
gtk_file_filter_set_name (filter, _("Drafts"));
gtk_file_filter_add_mime_type (filter, "application/x-drivel");
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter);
if(gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK){
gchar *filename, *uri;
filename = gtk_file_selection_get_filename(GTK_FILE_SELECTION(dialog));
if (dc->draft_filename)
g_free (dc->draft_filename);
dc->draft_filename = filename;
save_file (filename, dc);
uri = gnome_vfs_get_uri_from_local_path (filename);
egg_recent_model_add (dc->recent_model, uri);
g_free(uri);
retval = TRUE;
}else{
retval = FALSE;
}
gtk_widget_destroy (dialog);
return retval;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我还想在gtk_file_chooser_dialog_new对话框里加上一个按钮,行不行呢