tGtkGetFile() should now work on Win32 systems as well as GTK+. - vaccinewars - be a doctor and try to vaccinate the world
(HTM) git clone git://src.adamsgaard.dk/vaccinewars
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit f1fab42162b3785c602eda435fafc51b6d1b8dac
(DIR) parent 627eb9e4202027b39884cc2bc571e2da5e46e911
(HTM) Author: Ben Webb <ben@salilab.org>
Date: Mon, 8 Jul 2002 12:50:03 +0000
GtkGetFile() should now work on Win32 systems as well as GTK+.
Diffstat:
M ChangeLog | 3 +++
M src/gtkport/gtkport.c | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/ChangeLog b/ChangeLog
t@@ -1,3 +1,6 @@
+cvs
+ - Options dialog now allows sounds for all supported game events to be set
+
1.5.7 25-06-2002
- Sound support; Windows multimedia, ESD and SDL outputs are supported;
the individual modules can be statically linked in, or built as true
(DIR) diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
t@@ -5050,6 +5050,31 @@ void gtk_hbutton_box_set_spacing_default(gint spacing)
hbbox_spacing = spacing;
}
+gchar *GtkGetFile(const GtkWidget *parent, const gchar *oldname,
+ const gchar *title)
+{
+ OPENFILENAME ofn;
+ char file[800], filetitle[800];
+
+ memset(&ofn, 0, sizeof(OPENFILENAME));
+ ofn.lStructSize = sizeof(OPENFILENAME);
+ ofn.hwndOwner = parent ? parent->hWnd : NULL;
+ ofn.lpstrFilter = NULL;
+ ofn.nFilterIndex = 0;
+ ofn.lpstrFile = file;
+ ofn.nMaxFile = sizeof(file);
+ ofn.lpstrFileTitle = filetitle;
+ ofn.nMaxFileTitle = sizeof(filetitle);
+ ofn.lpstrInitialDir = NULL;
+ ofn.lpstrDefExt = NULL;
+ ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
+ if (GetOpenFileName(&ofn)) {
+ return g_strdup(file);
+ } else {
+ return NULL;
+ }
+}
+
#else /* CYGWIN */
guint SetAccelerator(GtkWidget *labelparent, gchar *Text,
GtkWidget *sendto, gchar *signal,