wxMax on Mac

BlitzMax Forums/Brucey's Modules/wxMax on Mac

Pete Rigz(Posted 2009) [#1]
Yep, I now have a Mac, so cue lots more stupid questions :)

Got TimelineFX editor compiling ok, there's a few layout issues to deal with, and a couple more weird ones, like nothing is being added to tree controls. So i thought I'd run the treectrl sample to see if that works, but I get compile errors on it, like GetItemText not found and MyTreeItemData not found, is the sample out of date?

I'm also getting these errors in the output window, although so far I can't if there's any adverse effects yet:



The Mac is pretty alien to me at the mo, I've not clue what I'm doing lol :)


Brucey(Posted 2009) [#2]
What Mac/OS/XCode versions do you have? :-)


Pete Rigz(Posted 2009) [#3]
erm, its a macbook, os 10.5.6, erm, how do i find out the xcode version?


Brucey(Posted 2009) [#4]
Launch XCode. The "Welcome To XCode" window usually says :-)


If you don't have an icon handy to launch it... on the desktop open the Drive, then Developer, Applications, and run XCode.


Pete Rigz(Posted 2009) [#5]
Ahh yeh, I'll find my way around eventually :), 3.1


Brucey(Posted 2009) [#6]
Well, that's essentially the same as me (except I've a Mac Mini).

On Mac, we need a few extra "tweaks" to get wxMax working properly. I'll assume that you haven't installed them yet... so...

Get BaH.AppStub module from either SVN or the maxmods download area. (http://code.google.com/p/maxmods/downloads/list?can=2&q=appstub)
Drop into the usual place :-)

You then need to run BMK with different options to use my appstub module instead of the default BRL one.
The easiest way is to use a custom-built IDE. There's one on this page, towards the bottom.
It has extra build commands to "build for wxMax". Instead of cmd-R and cmd-B, you use cmd-shift-R and cmd-shift-B.


That should keep you busy for a while ;-)


Pete Rigz(Posted 2009) [#7]
Cheers Brucey, will give it a go.


Pete Rigz(Posted 2009) [#8]
ok, now done all that but still the same issues, or is there still stuff to tweak? :)


Brucey(Posted 2009) [#9]
Seems the treectrl sample is indeed broken. Actually, by the looks of it, it's not been finished, so in some ways, I'm not surprised it doesn't compile.

As for your error messages, any clues as to which part of the API may be throwing those messages?

What version of wxMax are you using? I presume it's the 2.9 build?


On a brighter note, wxMax is now working with the latest BlitzMax threaded GC (to be released soonish). - well, it isn't crashing now, so I'm pretty confident that's a good sign.


Pete Rigz(Posted 2009) [#10]
Actually it's not 2.9 its the official release, I thought that'd be playing it more safe, would it be better to use 2.9 on the Mac? I didn't think the treectrl was complete hehe, I'll prolly do my own when I get to that bit then.

I haven't looked that closely at the error messages yet, they seem to come up every time a window is opened and closed, haven't done a proper step through on the debug yet though. I'll go install SVN and try things with the latest build.


Brucey(Posted 2009) [#11]
would it be better to use 2.9 on the Mac

It actually shouldn't make much difference.

Are you using images in your treectrl?


Brucey(Posted 2009) [#12]
If you want, you can drop me the source and I should be able to track down the problem more quickly.
Obviously, I'll understand if you don't want to do that, but it's always an option.

I'm fairly trustworthy :-)


Pete Rigz(Posted 2009) [#13]
There are images in the treectrl yeh. I have no problem sending you the source :) Let me just package it up a bit more coherently.


Pete Rigz(Posted 2009) [#14]
Thought I'd get the latest SVN version of wxMax. I checkout from http://wxmax.googlecode.com/svn/trunk/wx.mod/ but it just checks out about 5 files. I'm using SCPlugin to do it, am I doing something wrong? (probably am :)

[edit]doh, didn't tick recursive...


Brucey(Posted 2009) [#15]
doh, didn't tick recursive...

heh :-)


Pete Rigz(Posted 2009) [#16]
2.9 has fixed a few things, one of those being the attributes not being added to the list control properly, but, the flatnotebook stopped working, in that clicking on tabs doesn't actually do anything. It seems to be just happening with wxFNB_VC8 tabs. If I switch to another style however it works ok, but those error messages come back...


Brucey(Posted 2009) [#17]
but those error messages come back

Yeah, the fix I applied only affected VC8 tabs. If I hadn't been so lazy, I'd have gone through all of the tabs and fixed them in the same way.

I'll have a look at what might be wrong with the VC8 tab clicking in general.
Fiddling around in someone else's C++ isn't much fun :-p


Pete Rigz(Posted 2009) [#18]
Did you get any further with this Brucey? The flatnotebook issue is pretty much 1 of 2 outstanding issues with the Mac version, the other being that the shapes tab listctrl doesn't fill the whole space, haven't figure out what I'm doing wrong there yet as the samples work ok :)


Brucey(Posted 2009) [#19]
Amazingly, it seems one of the wxRegion constructors on Mac is currently no working (at least, in the version of wxWidgets that I've built against)... the code is commented out.

And it so happens that the vc8 tab calls this to create the shape of the tab button.

So.... for now, I think you should use the non-vc8 for Mac... until we come up with a better solution.

I've a fix for the other tab errors, but SVN is read-only at the moment, so I can't commit it for now..

I'll have a look at the shapes tab listctrl.


Pete Rigz(Posted 2009) [#20]
Yeh ok, that's no problem.


Brucey(Posted 2009) [#21]
Committed at last.

that listctrl sizing is a bit of a head-scratcher. Probably something really obvious too :-)


Pete Rigz(Posted 2009) [#22]
Yeh it's a bit bizarre :)


Pete Rigz(Posted 2009) [#23]
Is it me or does SetLabel not work on textctrl's? seems that way atm, will try a sample.


Pete Rigz(Posted 2009) [#24]
Looks like most of the issues that are in the windows textctrl are on the mac version, I think I raised an issue on the wxMax google code site.


Brucey(Posted 2009) [#25]
You should call ChangeValue() on a textctrl : "Sets the text value and marks the control as not-modified (which means that IsModified would return false immediately after the call to SetValue)."

Unless you are wanting to do something else with it?

Textctrls don't have labels?


Pete Rigz(Posted 2009) [#26]
ahh right ok. I use setlabel on windows and it seems to work ok so never really thought about it :) ta.


Brucey(Posted 2009) [#27]
the 2.9 release complicates things slightly, because wxTextCtrl now subclasses both wxControl and wxTextEntry... where wxTextEntry handles "text entry" type control features.

A problem for BlitzMax because we don't support multiple inheritance.

You could also call SetValue(), but it raises an event - so it depends if you want an event or not, the one you choose.


Pete Rigz(Posted 2009) [#28]
I looked at setvalue but it doesn't seem to exist for the textctrl? Either way tho, changevalue seems to do the trick.


Pete Rigz(Posted 2009) [#29]
I don't know if this is a bug or just typical behavior for a Mac, but when saving with a wxFileDialog the file extension isn't automatically added to the file if the user omits it. It seems this was the same bug here on GTK: http://trac.wxwidgets.org/ticket/9917 so I don't know if it's a bug on the Mac as well...


Brucey(Posted 2009) [#30]
Well, I can't see any code in the Carbon source which specifically adds the extension to the end.

No so sure about the Cocoa source though... It may be that there are more options available to Cocoa when creating a file dialog.

Looks like you'll have to do a check yourself.