[wxOSX] Status of wxCaret and wxOverlay

43 views
Skip to first unread message

KT

unread,
Sep 7, 2017, 5:41:09 AM9/7/17
to wx-dev
What is the current status of wxCaret and/or wxOverlay on wxOSX?

It seems, I guess, that they're not working properly. (samples/caret leaves artifacts all over the place; the background doesn't seem to get properly restored, etc.)

I notice that wxOSX actually isn't using the native overlay at all in wxCaret. (And as far as that goes, I don't see any way to enable it even though the source files exist. I tried manually defining wxHAS_NATIVE_OVERLAY in setup.h, but that leads to a host of compile errors.)

Am I correct in assuming that neither native wxOverlay nor wxCaret are functional for wxOSX?

(This is something I need, so I'll have to either figure out a way to get them working or implement an alternative.)

Stefan Csomor

unread,
Sep 7, 2017, 5:17:11 PM9/7/17
to wx-...@googlegroups.com

Hi

 

>What is the current status of wxCaret and/or wxOverlay on wxOSX?

 

I’ve written some code once for this, trying to port my carbon code over, but I havent’t finished things. I’ll look at caret sample when using that code

 

Best,

 

Stefan

 

KT

unread,
Sep 7, 2017, 5:40:53 PM9/7/17
to wx-dev

 >What is the current status of wxCaret and/or wxOverlay on wxOSX?

 

I’ve written some code once for this, trying to port my carbon code over, but I havent’t finished things. I’ll look at caret sample when using that code


If you'd like some help/someone to take a look, let me know. Otherwise (depending on timeline) I'll end up writing my own NSImage-screenshot-based workaround (or something). 

Stefan Csomor

unread,
Sep 8, 2017, 1:59:26 AM9/8/17
to wx-...@googlegroups.com

Hi

 >What is the current status of wxCaret and/or wxOverlay on wxOSX?

 

I’ve written some code once for this, trying to port my carbon code over, but I havent’t finished things. I’ll look at caret sample when using that code

 

If you'd like some help/someone to take a look, let me know. Otherwise (depending on timeline) I'll end up writing my own NSImage-screenshot-based workaround (or something). 

 

 

Thanks, although it’s not working yet, you could include things in your build by preparing the following, that way I could commit to overlay.mm in master without breaking something for the others

 

  • remove src/carbon/overlay.cpp and add src/cocoa/overlay.mm

 

  • change wx/overlay.h to turn native overlays on

 

#if defined(__WXDFB__)

    #define wxHAS_NATIVE_OVERLAY 1

#elif defined(__WXOSX__) && wxOSX_USE_COCOA

    #define wxHAS_NATIVE_OVERLAY 1

#else

    // don't define wxHAS_NATIVE_OVERLAY

#endif

 

  • change include/wx/private/overlay.h to include the correct one (carbon support has been removed from master)

 

#if defined(__WXOSX__) && wxOSX_USE_COCOA

    #include "wx/osx/cocoa/private/overlay.h"

#elif defined(__WXDFB__)

 

Thanks,

 

Stefan

Stefan Csomor

unread,
Sep 9, 2017, 7:44:55 AM9/9/17
to wx-...@googlegroups.com

Hi

 

 >If you'd like some help/someone to take a look, let me know. Otherwise (depending on timeline) I'll end up writing my own NSImage-screenshot-based workaround (or something). 

If you have modified your source according to my last post, you could pull again, I’ve updated the cocoa implementation. The caret sample works for me now, but the orientation of the drawing is upside down, doesn’t really matter for caret, but would for other overlays, I hope I’ll get my head around all modifications that have been done to the code regarding the current transformation matrix, then I hope I’ll find the right angle …

 

Best,

 

Stefan

Vadim Zeitlin

unread,
Sep 9, 2017, 8:37:09 AM9/9/17
to wx-...@googlegroups.com
On Sat, 9 Sep 2017 11:44:51 +0000 Stefan Csomor wrote:

SC> >If you'd like some help/someone to take a look, let me know. Otherwise (depending on timeline) I'll end up writing my own NSImage-screenshot-based workaround (or something).
SC> If you have modified your source according to my last post, you could
SC> pull again, I’ve updated the cocoa implementation. The caret sample
SC> works for me now, but the orientation of the drawing is upside down,
SC> doesn’t really matter for caret, but would for other overlays, I hope
SC> I’ll get my head around all modifications that have been done to the
SC> code regarding the current transformation matrix, then I hope I’ll find
SC> the right angle …

Sorry, I can't help you with this, but if wxOverlay now works (again?)
in wxOSX too, I think it would be really great to have a few more words
about it in the documentation because while it is formally documented now,
it's very difficult to see how it ought to be used and I admit I don't even
know it myself. A simple example in interface/wx/overlay.h would certainly
be very helpful, so if you have a few minutes to update it, it would be
great.

TIA,
VZ

Stefan Csomor

unread,
Sep 9, 2017, 9:38:27 AM9/9/17
to wx-...@googlegroups.com
Hi

Sorry, I can't help you with this, but if wxOverlay now works (again?)
in wxOSX too, I think it would be really great to have a few more words
about it in the documentation because while it is formally documented now,
it's very difficult to see how it ought to be used and I admit I don't even
know it myself. A simple example in interface/wx/overlay.h would certainly
be very helpful, so if you have a few minutes to update it, it would be
great.

Yes, I’ll do that, I thought I had written some sample code for rubberbanding somewhere. It was working in carbon, but never really in cocoa. And now I’ll have to find out how to best accomplish things after the matrix code has changed.

Best,

Stefan


Stefan Csomor

unread,
Sep 9, 2017, 2:42:46 PM9/9/17
to wx-...@googlegroups.com
Hi

Yes, I’ll do that, I thought I had written some sample code for rubberbanding somewhere. It was working in carbon, but never really in cocoa. And now I’ll have to find out how to best accomplish things after the matrix code has changed.

Ok, found a way to do it. Native overlay works for rubberbanding as well. I’ll turn it on by default now, so that we can get feedback.

What is the correct way nowadays to rebuild makefiles etc after having changed build/files

Best,

Stefan

Vadim Zeitlin

unread,
Sep 9, 2017, 5:37:23 PM9/9/17
to wx-...@googlegroups.com
On Sat, 9 Sep 2017 18:42:42 +0000 Stefan Csomor wrote:

SC> Ok, found a way to do it. Native overlay works for rubberbanding as
SC> well. I’ll turn it on by default now, so that we can get feedback.

Great, thanks!

SC> What is the correct way nowadays to rebuild makefiles etc after having
SC> changed build/files

Unfortunately you (still) need to run both upmake 0.x _and_ bakefile to
update everything, i.e.:

$ ./build/upmake
$ cd build/bakefiles
$ bakefile_gen.py

Regards,
VZ

Stefan Csomor

unread,
Sep 9, 2017, 5:41:01 PM9/9/17
to wx-...@googlegroups.com
Hi

SC> What is the correct way nowadays to rebuild makefiles etc after having
SC> changed build/files

Unfortunately you (still) need to run both upmake 0.x _and_ bakefile to
update everything, i.e.:

$ ./build/upmake
$ cd build/bakefiles
$ bakefile_gen.py

Thanks a lot, I’ve tried to do things correctly, unfortunately the old Xcode version doesn’t run on my system anymore, and the new one seems to have a problem with the script, so I did this small change by hand, and I hope I can find another solution later

Best,

Stefan

KT

unread,
Sep 10, 2017, 2:48:57 AM9/10/17
to wx-dev
Thanks so much. This is very helpful. (I got as far as getting overlay.mm hooked up and compiling/not quite working. But this goes the rest of the way.)

The only thing I notice is that, sometimes, it seems to miss the first blink. It's sort of hard to describe, but you can see it in the samples/caret if you try to move the caret while blinked out. It seems to wait an extra whole draw/erase cycle before reappearing. The code in the caret sample — and in my application, which shows the same behaviour — hasn't changed.

I'll have to try to figure out what's going on with that.

Again thanks for so quickly sorting this out.
Reply all
Reply to author
Forward
0 new messages