diff --git a/window.cxx b/window.cxx index 3c6b903..67f1298 100644 --- a/window.cxx +++ b/window.cxx @@ -2,6 +2,7 @@ #include #include +#include #include "event_handler.h" @@ -71,9 +72,15 @@ void go_fltk_Window_set_icons(Fl_Window* w, const Fl_RGB_Image *images[], int le } void go_fltk_Window_size_range(Fl_Window* w, int minW, int minH, int maxW, int maxH, int deltaX, int deltaY, int aspectRatio) { - w->size_range(minW, minH, maxW, maxH, deltaX, deltaY, aspectRatio); + w->size_range(minW, minH, maxW, maxH, deltaX, deltaY, aspectRatio); } +#ifdef _WIN32 +void* go_fltk_Window_win32_xid(Fl_Window* w) { + return fl_win32_xid(w); +} +#endif + const int go_FL_CURSOR_DEFAULT = (int)FL_CURSOR_DEFAULT; const int go_FL_CURSOR_ARROW = (int)FL_CURSOR_ARROW; const int go_FL_CURSOR_CROSS = (int)FL_CURSOR_CROSS; diff --git a/window.h b/window.h index 4bed2c0..8a65ca3 100644 --- a/window.h +++ b/window.h @@ -24,6 +24,9 @@ extern "C" { extern void go_fltk_Window_set_non_modal(Fl_Window *w); extern void go_fltk_Window_set_icons(Fl_Window* w, const Fl_RGB_Image* images[], int length); extern void go_fltk_Window_size_range(Fl_Window* w, int minW, int minH, int maxW, int maxH, int deltaX, int deltaY, int aspectRatio); +#ifdef _WIN32 + extern void* go_fltk_Window_win32_xid(Fl_Window* w); +#endif extern const int go_FL_CURSOR_DEFAULT; extern const int go_FL_CURSOR_ARROW; diff --git a/window_windows.go b/window_windows.go new file mode 100644 index 0000000..6aa6a67 --- /dev/null +++ b/window_windows.go @@ -0,0 +1,12 @@ +//go:build windows + +package fltk + +/* +#include "window.h" +*/ +import "C" + +func (w *Window) RawHandle() uintptr { + return uintptr(C.go_fltk_Window_win32_xid((*C.Fl_Window)(w.ptr()))) +}