Re: Best place to call gtk_widget_show()?



2005-08-16 (ç) ã 22:45 +0200 ã Markus Lausser ãããæãããã:
I wonder, in which order should the following tasks be done:
* show widget
* add widget to parent container
* add childs to widget

Which order is the fastest (CPU)?

Heh. CPU has exactly nothing to do with it. What you care about is user
perception, and only user perception. And here you get best results
showing widget as late as possible, because that means less potential
redraws done. So, the general rule is to call show() (or better yet,
show_all() somewhere high in hierarchy) as the last one. There are
gotchas here (some operations require realised window to work on, which
in practice means window that has been show()n, but it's a rare
occurence. Most of the time you don't even have to think about it)

Cheers,
Maciej

-- 
Being really good at C++ is like being really good at using rocks to
sharpen sticks. (Thant Tessman)
--------
Maciej Katafiasz <ml mathrick org>
http://mathrick.org




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]