We know Dave. 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.
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.
Nice, that you all pointed to my plugin
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
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
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
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.