[10506] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] blocking window

daemon@ATHENA.MIT.EDU (Andre' Karwath)
Sat Nov 28 15:39:43 1998

Date: Sat, 28 Nov 1998 20:43:57 +0100
From: "Andre' Karwath" <Andre.Karwath@informatik.tu-chemnitz.de>
To: gtk-list <gtk-list@redhat.com>
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Hello,

I'm about writing a program which allows the user to save some
data. I'm looking for a simpler method than I the one I'm using
at the moment:

file_save ()
 ... creates a file_selection window.
     If the user press OK/Cancel, file_save_ok () is called
     
file_save_ok ()
 ... if the selected file does not exist, file_save_ok_ok ()
     is called
 ... if the selected file exists, a message box appears and
     asks whether the file shall be overriden. After Yes/No,
     file_save_ok_ok () is called
     
file_save_ok_ok ()
 ... if the file exists and shall be overriden or if the file
     did not exist, finally it can be saved.


Now, I'm looking for a simpler method for doing this - something
like a blocking window, demonstrated by the following pseudo
code:

file=open_file_window ();
if file_exists (file)
   if !file_shall_be_overriden() return;
// now save the file

The major advantage is that I do not need three function for
such a small task and it would also avoid the globally holding
of the filename.

Has anyone an idea? Or does everybody this with three functions?


Thanks a lot for your help.

-- 
 _____  _   _  _____
(  _  )( ) ( )(  _  )                       PENGUINS ARE COOL
| (_) || |/'/ | (_) |
|  _  || , <  |  _  | ---------------------------------------
| | | || |\ \ | | | | andre.karwath@informatik.tu-chemnitz.de
(_) (_)(_) (_)(_) (_)          http://www.tu-chemnitz.de/~aka

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post