Hi,
How do you make a HUD Panel with the X close button and title, but with invisible title bar? Can’t find anything to make the title bar invisible.
Thanks,
kel
Hi,
How do you make a HUD Panel with the X close button and title, but with invisible title bar? Can’t find anything to make the title bar invisible.
Thanks,
kel
I’m thinking that I need to hide the title and add a button for closing the window and some text for the title.
Thanks,
kel
Hi,
What I was thinking of was something like Switch Control’s window when it is enabled.
Thanks,
kel
If memory serves right, then a borderless window doesn’t have a title.
Please refer to NSWindow reference or better the NSWindow programming Guide in your Xcode documentation set. I think there are some obstacles pertaining borderless/title-less windows, but I can’t remember exactly what it was.
Hi McUsr,
I can set the title bar to not show with IB, but the close button and title don’t show either. I was thinking that they used the HUD panel, because maybe it stands for heads up display. Can’t find anything on that so far at the Developer Library. I just thought of something, maybe there’s a way to make the title bar non-opaque while keeping the button and title. I’ll check that out.
I don’t remember seeing the borderless window in NSWndow, but that might be it also. I’ll check it out.
Thanks,
kel
Hi McUsr,
I think you’re right. Found this:
Thanks a lot,
kel
Hi,
After reading NSPanel, I think I did this before with the opacity of the window! Need to look at that project.
Thanks,
kel
Nothing worked so far. Used this to change border thickness:
HUDWindow's setContentBorderThickness_forEdge_(0.0,current application's NSMinYEdge)
Also, tried changing the opacity of the title bar, but the only way to do that was to use setAlpha which made the controls invisible also. When I set the window to textured, it changes from HUD panel to utility panel.
Running out of ideas unless I did something wrong. Maybe I’ll look more into style mask.
Thanks,
kel
Think I’ve found the answer on this page:
https://developer.apple.com/library/mac/documentation/userexperience/conceptual/applehiguidelines/Windows/Windows.html
That was an informative document, but it’s too general and doesn’t say how to have the title bar use the same background as the window content.
Getting close. I think it has something to do with:
Hope I don’t need to use that bitwise or thing.
Thanks,
kel
FWIW, Apple designs the frameworks to work in a particular way. What you’re trying to do is what is commonly known as “fighting the frameworks”, and it’s often (a) hard, and (b) a bad idea. Before you go any further, take a few minutes to ask why you need to do such a thing.
Hi Shane,
So what you’re saying is that you can’t get x close button, title, and invisible title bar with just ASOC. Thought I was getting close with setting the style mask of the window. I wonder what the integer is for invisible title bar, title, and close x button. May be tomorrow I might figure it out. Can’t stop thinking about it!
Maybe I should sleep.
Thanks,
kel
In Interface Builder enabling the title bar enables also the close button and the title string.
If the title bar is disabled the close button and the title are not available.
This is the normal behavior
Hello.
You could put an image into the hud window, and install a tracking rectangle, and monitor the mouse events when it enters the area you have designated at the close-box area.
That is a lot of work, and I’m not even sure if it is possible, nor usable with ASOC.
I think it’s described in Cocoa Event Handling Guide. (The monitoring of mouse handling events.)
Hi everybody,
The part I don’t understand is how they make those panels where the title bar is the same background as the window content and there’s a close button X and title. You see it in Switch Control and many panels. I’m thinking that they must add their own close button and title to a textured window or panel.
I checked out changing the window style mask and that doesn’t do it. I guess I’ll add my own close button and title to a non-titled window.
Thanks and have a good day,
kel
Hello.
Are you sure you have tried every possibility, like opaqueness, borderwidths and everything in Interface Builder?
Then it is time to go out and look for some cocoa libraries, that implement what you want.
Hello.
Trying to accomplish what you want, I also think you should read the Window programming guide, and there are some stuff for keeping your window focused in Cocoa Fundamentals.
Hi McUsr,
I’ve read the window programming guide several times. Whether I understand all of it is a different story. I don’t think it can be done with ASOC.
I also tried adding ‘Status bar style’ to the info plist and saw no changes in the HUD window when the project was run. Tried every option including 100% opaque. I’m thinking they changed things in Mavericks, because other things I’ve read on the internet don’t seem to apply to this Xcode version. For instance, they mention a navigation controller. There is no option for the title bar, but just the window content (view).
I’ll just embed a custom title bar in the untitled window unless someone comes up with a ASOC solution.
Edited: btw, in Xcode IB, when you Control click on one of the object icons, a completely opaque title bar panel opens as another example.
Edited: hard to let go of this. What I was thinking was that maybe they use the title bar and the toolbar. According to the docs, you can combine both to have the same background. I must try this out later.
Thanks a lot,
kel
You can have them appear pretty much as you like. But they involve custom views, which means containing their own custom drawing code. Some of that can be done in ASObjC, in theory, but probably not fast enough in practice.