From 8997131377a02004503c40ba2a96e6937bfd39c1 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 27 Aug 2014 11:55:57 +0000 Subject: Added the Fl_Shaped_Window class to support windows of arbitrary shapes. The new class is fully Doxygen-documented. Added an example program (example/shapedwindow.cxx) that exercises the new class. Modified all IDE-supporting files accordingly. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10255 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Fl_cocoa.mm') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 5de916139..68b21dc43 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2361,6 +2361,7 @@ void Fl_X::flush() fl_x_to_redraw = NULL; } +//bool Fl_X::make_shaped = false; /* * go ahead, create that (sub)window @@ -2517,6 +2518,10 @@ void Fl_X::make(Fl_Window* w) [cw setFrameOrigin:crect.origin]; [cw setHasShadow:YES]; [cw setAcceptsMouseMovedEvents:YES]; + if (w->type() == FL_SHAPED_WINDOW) { + [cw setOpaque:NO]; // shaped windows must be non opaque + [cw setBackgroundColor:[NSColor clearColor]]; // and with transparent background color + } x->xid = cw; x->w = w; w->i = x; x->wait_for_expose = 1; @@ -2645,7 +2650,7 @@ void Fl_Window::show() { labeltype(FL_NO_LABEL); } Fl_Tooltip::exit(this); - if (!shown() || !i) { + if (!shown()) { Fl_X::make(this); } else { if ( !parent() ) { -- cgit v1.2.3