Closed rjo closed 14 years ago
This is a known issue, the textbox draws continuously because of the cursor. I've got some test code to help fix it but am still researching a less hackish approach. Should have something in the next few days...
Ok...I can't find any way to fix this. That test code was a flop, if anyone has any ideas I'm all ears!! :)
binarygod, i just took a look at this and it seems this is triggering the problem: (line 199 in my revision)
[view setTextColor: [[[BGThemeManager keyedManager] themeForKey: self.themeKey] textColor]];
commenting that line out fixes the problem for me so apparently that is causing the view to think its dirty, causing a redraw and a retrigger. why is it necessary to change the view's text color?
The code you are looking at is the selection code for inactive, active selections in the textfield. I'm looking into why I did it that way in the first place, I have a terrible memory, I run out of space and throw stuff away that I shouldn't :(
Ok, that code was there to reset the text colors after a deselection of the text, otherwise the text that was selected stays the colors that it was while selected. Working on a solution right now!!
Fixes BGHUDTextFieldCell Continuous drawing.
Thanks to rjo for pointing out the culprite code, this issue is finally fixed. Closed by 72976e3d1b92537df004244b9a3d95669338d392
I was sitting here working on a beautiful hud window with an opengl view in it. I noticed that my drawing was strangely slow, and the response of my 3dConnexion Space Navigator very sluggish. Unable to figure out why, i threw together a new test project with a regular old window and suddenly my code ran at normal speed. I got to thinking that the only difference was BGHUDAppKit and decided to pull all the controls off my window. The app ran at the right speed. I tested with a couple of controls and only the text field seems to cause the slowdown. I added some debug output to the drawwithFrame: method and found that when it has the focus it is continuously drawing.
I've started looking at the code but don't have enough cocoa experience to diagnose this. I love the look of this framework but cant use it while this is slowing my code down so I hope someone can take a look at it!