Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use BWToolkit through code instead of IB

I'm trying to use BWToolkit to make a HUD-style button. Since Xcode 4 doesn't support IB plugins, I'm forced to make this button through code. After importing the framework and importing the header, I tried this:

BWTransparentCheckbox *button = [[BWTransparentCheckbox alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
[self addSubview:button]; 

I'd expect this nice-looking button:

button

However, this is what I get (minus the black border):

button

Any idea what I'm doing wrong here?

like image 538
sudo rm -rf Avatar asked Mar 10 '11 01:03

sudo rm -rf


People also ask

Can you pass IB without CAS?

CAS stands for Creativity, Activity and Service. It is a non-marked element of the International Baccalaureate (IB) Diploma, but the Diploma cannot be awarded without a pass in the subject of CAS.

What happens if you fail IB?

If a student fails an IB exam, he/she may retake it the next year. If a student has failed an exam at the end of grade 11, he/she may retake the exam in May of grade 12. The IB instructor works throughout the IB course to familiarize students with the sort of questions and activities they will face on the IB exams. 5.

Is 3 a fail in IB?

Students must achieve a total of at least 28 points, with a grade of '3' or higher in each eAssessment component, to be eligible to receive the IB MYP certificate.


1 Answers

You'll have to create the correct cell for your button. Something like this will get you closer:

BWTransparentButton *button = [[BWTransparentButton alloc] initWithFrame:NSMakeRect(0, 0, 136, 28)];
BWTransparentButtonCell *buttonCell = [[BWTransparentButtonCell alloc] init];
[button setCell:buttonCell];
[buttonCell setBezelStyle:NSRoundedBezelStyle];
[buttonCell release];
[self addSubview:button];
[button release];
like image 118
hjaltij Avatar answered Sep 29 '22 00:09

hjaltij