summaryrefslogtreecommitdiff
path: root/iup/test/predialogs.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/test/predialogs.c')
-rwxr-xr-xiup/test/predialogs.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/iup/test/predialogs.c b/iup/test/predialogs.c
index e7b36ea..570dffd 100755
--- a/iup/test/predialogs.c
+++ b/iup/test/predialogs.c
@@ -6,7 +6,25 @@
#include "iupkey.h"
#include "iupcontrols.h"
+//#define USE_GDK
+#ifdef USE_GDK
+#include <gtk/gtk.h>
+static void drawTest(Ihandle *ih)
+{
+ GtkWidget* widget = (GtkWidget*)IupGetAttribute(ih, "WID");
+ GdkGC* gc = widget->style->fg_gc[GTK_WIDGET_STATE(widget)];
+ int w = IupGetInt(ih, "PREVIEWWIDTH");
+ int h = IupGetInt(ih, "PREVIEWHEIGHT");
+ GdkColor color;
+
+ color.red = 65535; color.green = 0; color.blue = 0;
+ gdk_gc_set_rgb_fg_color(gc, &color);
+
+ gdk_draw_line(widget->window, gc, 0, 0, w-1, h-1);
+ gdk_draw_line(widget->window, gc, 0, h-1, w-1, 0);
+}
+#else
#ifdef WIN32
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
@@ -62,8 +80,12 @@ static void drawTest(Ihandle* ih)
XDrawLine(dpy, wnd, gc, 0, h-1, w-1, 0);
}
#endif
+#endif
#ifdef USE_OPENGL
+#ifdef WIN32
+#include <windows.h>
+#endif
#include <GL/gl.h>
#include "iupgl.h"
@@ -223,12 +245,12 @@ static void new_file(char* dialogtype, int preview)
// IupSetAttributes(dlg, "FILE = \"test.bmp\", DIRECTORY = \"/tecgraf/iup\""); // OK
// IupSetAttributes(dlg, "FILE = \"test.bmp\", DIRECTORY = \"\\tecgraf\\iup\""); // OK
// IupSetAttribute(dlg, "NOCHANGEDIR", "NO");
-// IupSetAttribute(dlg, "MULTIPLEFILES", "YES");
+ IupSetAttribute(dlg, "MULTIPLEFILES", "YES");
+ IupSetCallback(dlg, "FILE_CB", (Icallback)file_cb);
if (preview)
{
IupSetAttribute(dlg, "SHOWPREVIEW", "YES");
- IupSetCallback(dlg, "FILE_CB", (Icallback)file_cb);
#ifdef USE_OPENGL
if (preview==2)