Author Topic: CodeBlocks 16.01 not working completely on Mac OS X  (Read 9358 times)

Offline ridge

  • Multiple posting newcomer
  • *
  • Posts: 17
CodeBlocks 16.01 not working completely on Mac OS X
« on: January 22, 2017, 03:49:54 am »
CodeBlocks builds and runs (with some patches that have been posted in the forum) but the wxChoice items don't seem to show up (see attachment).

Does anyone have a solution yet?

CodeBlocks: v.16.01
OS: OSX 10.11.6 (El Capitan)
Compiler: g++ (clang compiler installed with Xcode command line tools)
wxWidgets: v.3.1.0

Thanks!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #1 on: January 22, 2017, 04:12:54 pm »
I don't think so. Someone with a mac an free time should try to debug it. I have a mac at home, but no free time at the moment. To be frank, I'm scared to build it on a mac, because there would be too many bugs I'd have to fix and I have no time to do it. :)

Also I think this was recently discussed somewhere either on the forum or in the ticket system. Don't remember where.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline yvesdm3000

  • Almost regular
  • **
  • Posts: 225
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #2 on: January 22, 2017, 09:06:39 pm »
Maybe try it with wx 3.0 ?

Yves
Clang based code completion for Code::Blocks:   http://github.com/yvesdm3000/ClangLib

Offline ridge

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #3 on: January 22, 2017, 09:16:14 pm »
I just installed wxmac (which reports as wxwidgets 3.0).
Still the same - wxChoice items do not appear on the toolbars.




Offline stahta01

  • Lives here!
  • ****
  • Posts: 7779
    • My Best Post
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #4 on: January 23, 2017, 12:20:03 am »
I just installed wxmac (which reports as wxwidgets 3.0).
Still the same - wxChoice items do not appear on the toolbars.

If wxGTK is a choice can you try that.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ridge

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #5 on: January 23, 2017, 05:24:33 am »
Yeah, I've also tried wxWidgets-2.8.  The problem does not appear to be with wxWidgets.
I can build an example wxWidgets project - wxChoice works just fine on Mac OS X (see attached).

It seems that the problem is in CodeBlocks...huh?

Any pointers?
« Last Edit: January 23, 2017, 05:31:40 am by ridge »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #6 on: January 23, 2017, 09:02:49 am »
The problem might be that we're building the toolbars using xrc files and not with code.
Probably there is something broken with the xrc stuff.

These are the files used for the compiler toolbar:
./plugins/compilergcc/resources/compiler_toolbar.xrc
./plugins/compilergcc/resources/compiler_toolbar_16x16.xrc

The code for the toolbar creation is in CompilerGCC::BuildToolBar method.
Can you try them in your sample?

Also there is no point using wx2.8. wx3.0 is the only thing that is going to work on osx. wx2.8 is known to be really buggy.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ridge

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #7 on: January 23, 2017, 11:34:44 pm »
Thanks oBFusCATed.

It appears that there is a custom control ("wxToolBarAddOn") that, for some reason,
doesn't play nice with wxChoice on Mac OS X.
Ok, I'll take a look at the BuildToolBar method...

My sample works on all versions of wxWidgets that I've tried.
However, I agree, it only make sense to use >= wx3.0.
wx3.1 doesn't seem to be any worse than wx3.0 and perhaps
has some bug fixes - any reason not to stick with wx3.1?


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #8 on: January 24, 2017, 12:59:54 am »
So the class of the toolbar doesn't play well with the wxchoice? This should be researched even further.

About wx3.1 - it is a development version. I'm using it to test things, but we need to support wx3.0 for most of the linux distros, so we cannot switch to wx3.1...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #9 on: January 24, 2017, 01:32:44 am »
So it seems the toolbar loading code is in xtra_res.cpp. Can you try to debug it and see what call is failing on OSX?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ridge

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #10 on: January 24, 2017, 07:03:54 am »
Actually, I'm not sure that a call is failing.  When I increase the width of the wxChoice object in compiler_toolbar_16x16.xrc, the toolbar extends accordingly.  Also, when I move the wxChoice between the other "tools", it takes up the correct amount of space.  So, the object is apparently "there" but just not visible.

UPDATE: I can replicate the behavior in my sample by calling wxChoice_instance->Show(false).

So, how could visibility get set to false?
« Last Edit: January 24, 2017, 09:03:36 pm by ridge »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6076
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #11 on: January 24, 2017, 08:21:21 am »

It appears that there is a custom control ("wxToolBarAddOn") that, for some reason,
doesn't play nice with wxChoice on Mac OS X.
Ok, I'll take a look at the BuildToolBar method...


FYI:
This custom control does not works quite well under Windows with wx 3.1(trunk), see here: toolbar bottom edge is not shown corectly under C::B build with wx git master
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ridge

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: CodeBlocks 16.01 not working completely on Mac OS X
« Reply #12 on: January 24, 2017, 06:50:50 pm »
Thanks for the link ollydbg.  Yes, I see that there are toolbar layout issues in Windows.
There are some layout issues in OS X, too, though not the same height issues as on Windows.
However, I notice (although only the top edge is showing in the link you provided) that the wxChoice items are visible.

I attached a screen shot for OS X in the original post, for reference.  Note that the toolbars that are supposed to contain
wxChoice items are 3 - 8 pixels taller.  I think this is a separate issue.  On OS X, the wxChoice
items are not visible in the custom toolbars - but they are visible in other dialogs.
« Last Edit: January 24, 2017, 10:49:12 pm by ridge »