diff options
author | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
commit | eed0eb6a476d54ce19aeff137984aa981d9e3976 (patch) | |
tree | 807891636efd2f87dcbd261e971216269973ae07 /iup/test/predialogs.c | |
parent | ccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff) |
Upgrading to iup 3.1
Diffstat (limited to 'iup/test/predialogs.c')
-rwxr-xr-x | iup/test/predialogs.c | 26 |
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) |