timthedevguy / BGHUDAppKit

* BGHUDAPPKIT is no longer under development by me, I hope that the community will keep it alive and going as I no longer have time to dedicate to the project** The missing HUD controls. Please scroll down to read the readme file for an important notice concerning the future of BGHUDAppKit. Note that there are multiple versions available, 10.5+, 10.6.7, and now 10.7. As soon as I learn how I'll make these all one code base if possible.
http://www.binarymethod.com/
312 stars 57 forks source link

How to create a matrix/ radio buttons #7

Closed frankrei closed 14 years ago

frankrei commented 14 years ago

Hi,

First of all thanks for the terrific framework.

I'm just working on adopting it but I'm running into a few issues and there seems to be little documentation so I'll have to resort to asking my questions on here..

In the Interface Builder palette there's a bunch of pre-defined elements, but there's nothing for making radio buttons. I figured, I'd just add an NSMatrix with the normal buttons and replace the cells with BGHUDButtonCell using the "Radio" bezel and type, but that just makes the radio buttons disappear altogether.. I'm sure I'm missing something fundamental here.. any help would be appreciated.

Best regards,

Frank

timthedevguy commented 14 years ago

Frank,

So sorry for the delay, Thanksgiving holiday threw my schedule for a loop, I read this message the day I got it but wasn't able to play with it until later, by that time I completely forgot why I was playing with it.

This is a known issue with BGHUDAppKit, and here is the work around.

1) Drop a normal Radio Button NSMatrix to where you want it, set your rows/columns. 2) Click on the first Radio button and then click again, it should enter cell mode (Where the rest of the window goes dark and the area around the button is lighter) 3) Open your inspector panel and go to the Identity tab, last tab (Circle with a !) 4) From the Class dropdown select BGHUDButtonCell 5) Go back to the Attributes tab (first one) and type in NSRadioButton in the image box (The image doesn't exist but thats ok, the image is an apple internal thing that they use)

Repeat steps 2 - 5 for each Option you have.

After that your good to go, for some reason the only way I could get it to work in an NSMatrix was using this weird method. For some reason when an NSButton is inside of an NSMatrix it ignores the assigned Bezel style, what happens when you use a normal button and assign it to a Check/Radio Bezel style is an Image is assigned, NSSwitch or NSRadioButton. So in order for BGHUDAppKit to figure out what kind of control it was supposed to draw we had to tell it what image it's normally assigned.

Don't worry, the NSMatrix will look like utter crap in design view, but run it and it will look normal.

frankrei commented 14 years ago

Not to worry.. it worked like a charm, I really appreciate your help.