In my experience, drawing widgets using code is rarely a good idea even in Cocoa. Many programmers are not used to dealing with artistic considerations and are more of the engineer mindset, so you end up having to iterate for a long time to come up with pixel perfect drawing code. Images provide precision and flexibility for the designer.
There is one type of drawing which is best done in code: if a widget needs to stretch in the direction of a gradient, or if it needs to stretch and has a noise pattern. If you use images for this the result cannot be perfect. Scaling noise isn't possible at all - your pattern of 1x1 noise dots turns into 1x1.34 dots or other arbitrary sizes. Scaling gradients is somewhat possible if done lightly, but if you scale a gradient to be to be larger you may get banding and destroy any dithering effect.
If you try to switch buttons to use a 9-part image you'll get this problem as well. The taller the button is made, the more wrong the vertical gradient in it will look.
Alexander
> --
> You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
> To post to this group, send email to
objec...@googlegroups.com.
> To unsubscribe from this group, send email to
objectivej+...@googlegroups.com.
> For more options, visit this group at
http://groups.google.com/group/objectivej?hl=en.
>