Monthly Archive for October, 2006

Loosing nerves…

Every once in a while a day like yesterday happens and I feel like shooting someone in the knee to share my pain! I’ve spent the last few days trying to figure out how to get the DrawingArea scroll nicely inside a ScrolledWindow. With absolutely no luck of course. I realize that I’m lacking basic knowledge so I looked for some examples all over the web. It’s probably bread and butter for anyone with Gtk+/Gtk# experience, but apparently it doesn’t make it well documented. Seriously, Gtk# and “well documented” should not be used in the same sentence. If there is somebody (Novell?) who cares about adoption of Gtk# for cross-platform development, they should put some effort into making it all more approachable.
On the other hand - PyGTK examples were poping up everywhere. Maybe I started learing the wrong language…
Anyway, that’s what my problem looks like
…before scrolling:

screenshot_186_cut.png

… after scroling:

screenshot_187_cut.png

… and after re-exposing:

screenshot_188_cut.png

All suggestions highly appreciated…

I nailed the sucker…

So, the problem with slow drawing was indeed my fault. The calculation of every topic’s position was repeated through all previous topic on all higher levels. Now I calculate it just once for every topic and I can draw hundreds of topics in a blink of an eye. Another small step forward and I can already see a few more places for improvement.

Not a memory leak…

So, it’s all coming together quite nicely, but the problem with the speed of drawing is killing me. I’m (almost) sure that it’s not a cairo related memory leak. I .Destroy() everything I can. It must be just something with my drawing procedures that iterate back and forth through the tree. Obviously I don’t do it in the most effective way. The problem is I don’t know many ways… I definetely need some help. Anyone, please!
screenshot_180_cut1.png



UA-1333993-1