FROM : M Pulis
DATE : Tue Nov 18 10:19:38 2008
Folks,
I have an NSControl, in IB i've set a shadow and a color (green). it
has an IBOutlet and is "hooked" up to my controller. When my app is
run, the checkbox has a lovely green shadow. Go baby go....
During runtime I want to change the shadow color - but am failing to
do so. So, to simplify the logic...
In awake from nib I see the control (mCheckbox) is not nil, so I try
to set the shadow color to black :
IBOutlet NSControl *mCheckBox;
/* awakefromnib */
NSShadow *aShadow = [mCheckbox shadow];
[aShadow setShadowColor:[[NSColor blackColor] colorWithAlphaComponent:
1.0]];
[mCheckbox setShadow:aShadow];
No change. No errors. Nothing nil.
Looks like it makes sense to me... but... it does not work, so, I'm
missing something... somewhere... should be obvious.... just not to me.
Been searching docs and sample code bits (have not found an example
of changing a shadow on a control) - trying foolish things - stuck.
This has to be simpler than the two hours spent getting this far.
Thanks!
Gary
DATE : Tue Nov 18 10:19:38 2008
Folks,
I have an NSControl, in IB i've set a shadow and a color (green). it
has an IBOutlet and is "hooked" up to my controller. When my app is
run, the checkbox has a lovely green shadow. Go baby go....
During runtime I want to change the shadow color - but am failing to
do so. So, to simplify the logic...
In awake from nib I see the control (mCheckbox) is not nil, so I try
to set the shadow color to black :
IBOutlet NSControl *mCheckBox;
/* awakefromnib */
NSShadow *aShadow = [mCheckbox shadow];
[aShadow setShadowColor:[[NSColor blackColor] colorWithAlphaComponent:
1.0]];
[mCheckbox setShadow:aShadow];
No change. No errors. Nothing nil.
Looks like it makes sense to me... but... it does not work, so, I'm
missing something... somewhere... should be obvious.... just not to me.
Been searching docs and sample code bits (have not found an example
of changing a shadow on a control) - trying foolish things - stuck.
This has to be simpler than the two hours spent getting this far.
Thanks!
Gary
| Related mails | Author | Date |
|---|---|---|
| M Pulis | Nov 18, 10:19 | |
| Ken Ferry | Nov 20, 08:06 | |
| M Pulis | Nov 20, 08:32 |






Cocoa mail archive

