Black Windows

We know Dave. :slight_smile: The point is, if the plugin is letting you do it, then you can do it yourself through a mix of declares and code.

[quote=78541:@Christoph De Vocht]Made a simple black window. Using MBS plugins.

If you could share the code, it would be greatly appreciated. Thank you in advance.

[quote=78602:@Michel Bujardet][quote=78541:@Christoph De Vocht]Made a simple black window. Using MBS plugins.

If you could share the code, it would be greatly appreciated. Thank you in advance.[/quote]
http://www.monkeybreadsoftware.net/example-cocoabase-customnswindows-nswindowlikeqtplayer-qtplayernswindow.shtml

[quote=78592:@luciano monti]Christoph, please could You share The snippet ?

Thanks

Luciano[/quote]

It would be a large snippet. :slight_smile:
Please take a look at the MBS examples “Custom NSWindow”.

This for the complete QT Player. For getting the black window a lot can be removed. :slight_smile:

Nice, that you all pointed to my plugin :slight_smile:

Yes, this could prob. be done with MacOSLib as well. The titlebar part.

i have a fake “black window” (OSX)
maybe you can take something from it
BlackWindow

Talking about a needle in a hay stack :frowning:

Christian, could you point to the exact plugin to use for that black window only ? TIA

[quote=78623:@Axel Schneider] have a fake “black window” (OSX)
maybe you can take something from it
BlackWindow [/quote]

Nifty. I like the RemoveTitleBar method :slight_smile:

If you subscribe to xDec magazine I wrote an article with a couple of Window Tricks, one being how to place controls in the Window Titlebar.

http://www.xdevmag.com/browse/12.1/12104/

You can also get a black framed Window, by switching it’s style to metal and then setting a background color.

Only problem with that method (and I had tried it)… is the Title Text looks terrible… as it stays black so all you see it the Shadow :frowning:

Then, I’d suggest setting the window title to “” and using the code in the article to position a label in the titlebar.

Thanks for the idea… but I don’t subscribe to the magazine

Did you try Sam’s suggestion? Metal window, black background color, blank Title property, drag a label to where the title would be. Looks good to me.

So how do you position the label OUTSIDE of the work area of the window then? Negative coordinates don’t cut it

I plan on writing a class to encapsulate all these functions, control the color, manage the new “title” which would include re-centering when window size changed etc.

[quote=78804:@Gavin Smith]Did you try Sam’s suggestion? Metal window, black background color, blank Title property, drag a label to where the title would be. Looks good to me.

[/quote]

Did you run it? I did just like you said, but when I run it, the label doesn’t show. (Although it does look nice in the IDE.)

I’m guessing the Label is still added to the contentView and that’s why it clips out. You need to add it to the superView of the contentView as jim mckays example does and every other example I’ve found. Seems theres no public access to the text widget of the title bar text and you’ll have to recreate it, either via declares or maybe you can pass in a Xojo Label (which I’m sure they won’t like:)

Ah, gotcha. It’s Declare time then (or probably simpler, MacOSLib time). I’ll take a look tonight if no-one else has nailed it (plugin-free) by then.

it should work
window can set back ground color
just need to deal with altering the frame as well

This is working for me to have the Label show up in the title bar. Put in the windows Open

[code] declare function contentView lib “Cocoa” selector “contentView” (id As integer) As Ptr
declare function superView lib “Cocoa” selector “superview” (id As Ptr) As Ptr
declare function subviews lib “Cocoa” selector “subviews” (id As Ptr) As Ptr
declare function objAtIdx lib “Cocoa” selector “objectAtIndex:” (id As Ptr, idx As UInt32) As Ptr
declare sub addSubView lib “Cocoa” selector “addSubview:positioned:relativeTo:” _
(id As Ptr, aView As integer, order As integer, rel As Ptr)

dim cv As Ptr = contentView(self.Handle)
dim themeFrame As Ptr = superView(cv)
dim firstSubView As Ptr = objAtIdx(subViews(themeFrame), 0)
addSubView(themeFrame, Label1.Handle, 0, firstSubView)[/code]
Note, this is doing it the way I think the engineers won’t like, and rightly so. If its too corrupt you’ll need to instantiate some NSText thing to add instead of Label1.Handle.