GNOME Bugzilla – Bug 525847
No gtk_file_chooser_get_current_name()
Last modified: 2016-04-06 20:49:16 UTC
There is no getter for the current_name attribute, only the setter gtk_file_chooser_set_current_name(). You need a getter for unit testing and it could also be marginally useful for other purposes. The attribute should match what is in the location entry and probably be NULL if there is no location entry in the file choosers current action mode.
*** This bug has been marked as a duplicate of 328092 ***
I have confirmed this bug exists and has not been fixed. This bug was not addressed or resolved either by 328092 or by 135901. The function gtk_file_chooser_set_current_name exists and works The function gtk_file_chooser_get_current_name will not link I looked at the libgtk-3-0.dll and the function was not listed as an export there, nor in any other dll issued by GTK. I looked at the header file, gtkfilechooser.h, and although I could see that gtk_file_chooser_set_current_name and gtk_file_chooser_get_current_name were defined, they were prototyped differently: GDK_AVAILABLE_IN_ALL void gtk_file_chooser_set_current_name (GtkFileChooser *chooser, const gchar *name); GDK_AVAILABLE_IN_3_10 gchar *gtk_file_chooser_get_current_name (GtkFileChooser *chooser); I am not familiar with the GDK_AVAILABLE macros, so I'm not sure if this is the problem or not. Also, I believe they use GCC to compile GTK, but I'm not sure, so the fact that they prototype gtk_file_chooser_get_current_name as, gchar *gtk_file_chooser_get_current_name instead of gchar * gtk_file_chooser_get_current_name as they do for gtk_file_chooser_set_current_name, might be the problem, but I don't know. I all know is that linking to gtk_file_chooser_get_current_name will throw errors because the function is not present in any of the runtime DLLs that GTK has issued. I am using runtime version 3.8.1-i686.
Let me clarify: gchar *gtk_file_chooser_get_current_name is not the same as all the other functions, such as gchar * gtk_file_chooser_get_filename or gchar * gtk_file_chooser_get_current_folder (note the extra space) The difference between gtk_file_chooser_set_current_name and gtk_file_chooser_set_current_name that I am concerned about is the GDK_AVAILABLE_IN_ALL and the GDK_AVAILABLE_IN_3_10 Does that mean gtk_file_chooser_get_current_name was only available in version 3.1? Why doesn't it say _ALL like gtk_file_chooser_set_current_name does? The GTK manual says the function is available in all.
I also forgot to add I am using the Win32 runtime version.
GDK_AVAILABLE_IN_3_10 means that the symbol is available since GTK+ 3.10, not 3.1. If you're using GTK+ 3.8, then it means you don't have that symbol — hence why you can't use it. You need GTK+ 3.10 or newer in order to use gtk_file_chooser_get_current_name().
Okay, my mistake. I had a hard time finding the GTK runtime I was using for windows as is, since Google kept redirecting me to version .1 everytime I typed .10. I found a site that has the latest precompiled version for windows at http://lvserver.ugent.be/gtk-win64/. I just hope this 64-bit version doesn't cause other problems for me or my users.