Old versions of the file chooser's documentation suggested using gtk_file_chooser_set_current_folder() in various situations, with the intention of letting the application suggest a reasonable default folder. This is no longer considered to be a good policy, as now the file chooser is able to make good suggestions on its own. In general, you should only cause the file chooser to show a specific folder when it is appropriate to use gtk_file_chooser_set_filename() - i.e. when you are doing a File/Save As command and you already have a file saved somewhere.
每次都设置当前文件夹对我都有效,但有点棘手。我使用的是gtk3.14和python2.7。在
在重置目录之前必须获取文件名,否则它会丢失,而当前目录可能是None,因此您必须进行检查。在
这段代码在DebianJessie和Windows7上进行了测试。在
从文件中:
你可能喜欢也可能不喜欢这种行为的原因。如果您想知道它是如何产生的,请参见邮件列表中的File chooser recent-files和gnomewiki上的Help the user choose a place to put a new file。在
相关问题 更多 >
编程相关推荐