Is there an easy way to make all windows in an app have a Black Theme (like Pixelmator for example)?
I don’t have Pixelmator, but I think I know what you mean. Still, a screen shot would help, if you have one.
Will your app be Mac-only?
poke about with MacOSLib and NSWindow
Yes… OSX only… and the “black theme” needs to affect “my” app only… not system wide.
MacOSLib has code for HUD windows (ie the tool/brush windows above)… but can’t find anything for a “document” type window
For a start - not the Window but the objects, check out:
Then I think you only need to fuss with the titlebar.
It’s really really tempting! I’d like to know how to get the Window looking like that, I’d seriously think about converting many of my apps to look that way.
The controls I have no problem with… it is just the window I need
My app has few controls… and what it has are all ones I custom wrote for this app.
Well I found a way to “fake” it… but it doesn’t look too great.
Set window to have a custom background color… but the window title is not “white” like the above examples… but a muted gray
There has to a system call for this. Have you looked at MacOSLib?
I googled for NSWindow black title bar and got a couple of hits that explained things in ObjC, that would be the first hint to using MBS or MacOSLib for it. Perhaps we just need to do the titlebar.
I thought this was interesting:
I wish I could check this out today with everyone but I have a busyish day, this would be of interest to me.
You need to put a custom NSView on top of the orig. title bar. and draw the buttons yourself. MBS does it this way - I think it might be possible with MacOSLib.
With MBS this is possible. Maybe Christian can gives some hint which declare to use.
How did you do it with the plugin? Perhaps that will show a way to do it with the declares directly.
I suggest looking at the MBS example : Custom NSWindow
I’ve done this using MBS plugins I can’t seem to get the text to look bold though. And there is no file icon…
I set the NSWindowMBS’s background color and added an NSTextViewMBS to the TitleBar. No need to draw the buttons, just make sure the NSTextView doesn’t overlap the buttons.
The code isn’t pretty- but…
tv= new NSTextViewMBS(Width/2-50,Height,120,21) //this size is hardcoded--should be based on the window...
tv.autoresizingMask = NSViewMBS.NSViewMinYMargin+NSViewMBS.NSViewMaxXMargin+NSViewMBS.NSViewMinXMargin
Christoph, please could You share The snippet ?
For the record (for me) MBS is not an option…