I'm adapting a Linux program to run under Windows, using gtk-win32.  The app 
has a particular dialog box which displays a Gtk::FileChooserButton.  When the 
dialog first gets displayed, there's no particular file selected and the 
button's entry says "(None)".  Clicking the button launches a Gtk::FileChooser 
and the chosen file then gets "remembered" by the button.  In other words, next 
time the main dialog box gets displayed, the last file to be chosen is 
effectively pre-selected into the FileChooserButton.  This seems to be achieved 
by calling Gtk::FileChooser::set_filename()

All the above works fine.  But under certain circumstances I don't want any 
file to be preselected.  Even if the dialog has been shown before I want the 
FileChooserButton to say "(None)" when it's next displayed (like it did the 
first time around).  I assumed that I might be able to achieve this by calling 
Gtk::FileChooser::set_filename() with an empty string.  And indeed that does 
seem to work when I build under Linux.  But it doesn't work for me if I compile 
for Windows and link to gtk-win32.  Passing an empty string seems to do some 
strange things.  Firstly, it bizarrely selects whichever folder the main app is 
running in.  Secondly, if I press the button to display the FileChooser, the 
FileChooser won't respond to mouse clicks (although it continues responding to 
mouseover events).

If all else fails I guess I could delete the FileChooserButton object and 
create a new one each time.  But before I consider that option I just wondered 
if I'm doing something obviously wrong.  Is there an actual recommended way of 
removing a file that's currently in the FileChooserButton's memory?  (i.e. 
resetting its entry back to "(None)".

John
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to