Re: Suggesting file extension in GtkFileChooser Save dialogs?
- From: Brian <dol-sen telus net>
- To: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Re: Suggesting file extension in GtkFileChooser Save dialogs?
- Date: Wed, 22 Sep 2004 23:19:39 -0700
On Tue, 2004-09-21 at 07:51, Thomas Klausner wrote:
Hi!
Is there a way to suggest a file extension in a GtkFileChooser
Save dialog?
I could use gtk_file_chooser_set_current_name, but when the user
starts typing, the extension is lost. IIRC, OS-X selects only the
filename part of a file by default. Can I do that in gtk2 too?
Cheers,
Thomas
In my python program it does not loose anything you do not delete on
purpose.
def save_as_buffer(self):
dprint("LOG: Entering save_as_buffer")
return FileSel(self.title + ": Save File").run(self.window,
self.filename, self.save_as_ok_func)
def save_as_ok_func(self, filename):
"""file selector callback function"""
dprint("LOG: Entering save_as_ok_func")
old_filename = self.filename
if (not self.filename or filename != self.filename):
if os.path.exists(filename):
err = _("Ovewrite existing file '%s'?") % filename
dialog = gtk.MessageDialog(self.window,gtk.DIALOG_MODAL,
gtk.MESSAGE_QUESTION,
gtk.BUTTONS_YES_NO, err);
result = dialog.run()
dialog.destroy()
if result != gtk.RESPONSE_YES:
return gtk.FALSE
self.filename = filename
--
Brian <dol-sen telus net>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]