twitter-archive / twui

A UI framework for Mac based on Core Animation
Other
2.74k stars 268 forks source link

TUIButton does not render properly? #100

Closed avaidyam closed 12 years ago

avaidyam commented 12 years ago

I'm trying to use TUIButton without external graphics, so I'm using setDrawRect: and calling the TUIButton's drawRect from within that, but I notice that the label is horribly placed, and the states aren't defined well. Is there a way to set custom Core Graphics "drawRects" for TUIButtons on different states? And how should I go about fixing the position of the label? I've looked through TUIButton's implementation, but I don't see how it draws incorrectly.

avaidyam commented 12 years ago

Found a simple fix: Just use TUIButton's +imageWithSize:drawing: to set states, and use TUIControlEventTouchUpInside instead of TUIControlEventTouchDown. Sorry for opening such a trivial issue! :]