TUITextView and TUITextRenderer #99

Closed
avaidyam opened this Issue Feb 25, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@avaidyam

I've been trying to get TUITextView to scroll properly like NSTextView, and I decided to start by switching TUITextRender to subclass TUIView... anyone want to point me on what I should do next? The entire architecture of TwUI is completely different than both UIKit and AppKit.

@mrjjwright

This comment has been minimized.

Show comment
Hide comment
@mrjjwright

mrjjwright Mar 27, 2012

I also am set to do this. I will let you know if I get it working. It involves enclosing the TUITextView inside a TUIScrollView and setting the contentHeight of the TUIScrollView as the user types by using the text renderer to measure the string. It really shouldn't be that hard but I could be wrong.

I also am set to do this. I will let you know if I get it working. It involves enclosing the TUITextView inside a TUIScrollView and setting the contentHeight of the TUIScrollView as the user types by using the text renderer to measure the string. It really shouldn't be that hard but I could be wrong.

@avaidyam

This comment has been minimized.

Show comment
Hide comment
@avaidyam

avaidyam Mar 27, 2012

I've tried manually offsetting the frame- doesn't work. I've tried switching the superclass to TUIScrollView- it half works in the sense that everything was borked and I didn't bother fixing the views and layouts. iOS and Cocoa both subclass from scroll views, so why is TwUI subclassing TUIControl...?

I've tried manually offsetting the frame- doesn't work. I've tried switching the superclass to TUIScrollView- it half works in the sense that everything was borked and I didn't bother fixing the views and layouts. iOS and Cocoa both subclass from scroll views, so why is TwUI subclassing TUIControl...?

@avaidyam

This comment has been minimized.

Show comment
Hide comment
@avaidyam

avaidyam Mar 31, 2012

Alright- quick update: Looks like modifying TUITextRenderer is a horrible idea, and so is manually scrolling, like in the TUITextField. What I tried to do did not work well because the cursor started floating in random places and the there was odd text margins, and worst of all, the text didn't scroll back up or down after the bounds were exceeded. How do other implementations do it? It looks like AppKit, UIKit, and Chameleon all subclass a scroll view....

Alright- quick update: Looks like modifying TUITextRenderer is a horrible idea, and so is manually scrolling, like in the TUITextField. What I tried to do did not work well because the cursor started floating in random places and the there was odd text margins, and worst of all, the text didn't scroll back up or down after the bounds were exceeded. How do other implementations do it? It looks like AppKit, UIKit, and Chameleon all subclass a scroll view....

@avaidyam

This comment has been minimized.

Show comment
Hide comment
@avaidyam

avaidyam Apr 2, 2012

Oh! Someone's done it. Just found the branch: https://github.com/michaelvillar/twui

Next step, making all of this happen without putting the text view inside a scroll view...

avaidyam commented Apr 2, 2012

Oh! Someone's done it. Just found the branch: https://github.com/michaelvillar/twui

Next step, making all of this happen without putting the text view inside a scroll view...

@joshaber joshaber closed this May 11, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment