HUD Panel close button

Got it working! What I did was add a toolbar to the HUD panel. After running it a couple of times, I deleted the toolbar. When run, the title bar had the same background as the panel content! :smiley:

Learned a lot about windows and panels! :smiley:

Edited: almost forgot this main thing. I think you need to check ‘Unified Title And Toolbar’ in Interface Builder’s Appearance Attributes.

Edited: created a new test project and the method is not working. I must have set something else in the other project. Trying to find the steps needed.

Edited: that wasn’t it. :frowning: I had added a ‘display dialog’. when the dialog comes to the front, the HUD panel title bar becomes like the window content. Darn, thought I had it.

Thanks a lot for all the ideas,
kel

Hello

Congrats kel. :slight_smile:

Now I have to speed up a bit, to be able to “chew on this”. Work is like the rain, it never stops.
I think this can be rather good from ASOC, as long as there isn’t too complex drawing “in the HUD”.

But controls with outlets should be good, and you can allways drag a custom view made with Objective-C into the Hud, then there aren’ much that can slow it down. :slight_smile:

Hi McUsr,

It only worked when I displayed a dialog and I think the HUD panel was not the key window. But, this gave me a hint. I need to make the panel never become key with:

Then the panel becomes key only if there is a text field that the user clicks into. So, if there is no text field, then it never becomes key and the title bar background will always be the same as the window’s content background.

It’s getting late though and I’ll try it tomorrow when I get back, if I can take a nap. I really think this is the solution. :slight_smile:

Also, I should set the panel as floating so the user can get to the buttons or whatever with ‘setFloatingPanel:’.

Later,
kel

Hello.

The trouble you are going to experience if you do this, is when your app is not the active one, if you still want to display a floating palette. The fix is written in the end of Cocoa Fundamentals.

Have a good night. Great minds think alike! :slight_smile:

Good morning McUsr,

It works! I just used this:

hudPanel's setBecomesKeyOnlyIfNeeded_(true)

I’m not sure why, but by default the HUD panel is floating. I could turn the floating off and on if the panel gets in the way, but another way is to hide the app. Not sure which is best yet. I still need to think about the modal settings. It didn’t matter much in my case.

I was thinking about maybe using the toolbar. A button could get the panel out of the way. Also, I might add a slider for opacity, and some switches to change different sets of buttons. Getting all kinds of ideas. Fun! :smiley:

Edited: also, I was thinking about adding a minimize button.

Edited: btw, the name of the app is “Funkys”. :stuck_out_tongue:

Have a good day,
kel

Hi McUsr,

I found a good place to put the hudPanel “Funkey”. In the top middle of the screen is a good place because the menus drop down above the panel. At the bottom, the dock’s magnification sometimes get in the way.

Just thought of this. When you open a document it opens on the top. Just thought of something. If you open a document and the panel is blocking it, then the program should move the panel to the bottom or somewhere else that is less intrusive. Think I read something about that.

Later,
kel

Come to think of it, a good place to put it might be under the Apple menu. Then, you can have different sets of buttons for different apps also. That might be a good idea. Adding something to the Apple menu like the old Apple menu.

I think I see what you were writing. When you click on a button in the app, it becomes frontmost. Need to fix that.

gl,
kel