Re: [gtk-list] Realizing windows.



>I brought up this question a while back and have been looking through
many
>GTK+ programs to see how people deal with the issue...
>
>What is the difference between realizing a window (widget) and
showing it?
>...and when do you do which?
>
>My conclusion follows, so please correct me if I am wrong:
>
>    Realizing a widget can be done *after* it is created but *before*
it
>    is shown.  In a complex window, you can build the window ahead of
time
>    and realize it (thus allowing the application to figure out how
to
>    position widgets in the window).  When you finally *need* it, you
just
>    "show" it and it pops up on the screen...faster than if you have
to
>    build the window right after, say, a button press.
>
>While this is a generality, it seems logical enough to prove a
distinction
>between when you would realize and show a widget.  If you are
building the
>main/first window of an application, you don't need to realize it
because
>that's not going to do anything.  (Okay, it *does* something, but you
>don't really *gain* anything from that procedure like you would if
you
>realized a complex widget ahead of time.)
>
>...am I way off base, or does this seem logical enough?
>
>
>Paul Braman
>aeon@tampabay.rr.com
>
>-- 
>To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com <
/dev/null
>

You're basically right.  From what I gather, realizing a widget will
basically allow GTK+ to gather information about a widget without
having to show it.  This is actually useful.  Whenever I write an app
that uses pixmaps (ie in toolbar buttons), naturally I want to be able
to "show" the buttons before showing the window.  However, if I don't
realize the window first, there's no associated colormap for it, and
thus I get a slew of warnings about a NULL colormap.  Realizing the
window and THEN making the toolbar with pixmap buttons gets rid of
this problem.


_______________________________________________________________
Get Free Email and Do More On The Web. Visit http://www.msn.com



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