Re: How would I use casting ?



Hi,

Dipak G Patil <dippatil in ibm com> writes:

> I asked just you because, you have said following method is not best
> way but neither told why nor suggested best way. And obviously such
> statement would make anybody confused.

OK then, perhaps it's time to repeat it once more then. A widget
doesn't have a GdkWindow until it is realized. If you want to
understand why this is the case, then you should make yourself
familiar with the basics of the X11 windowing system.

In general you rarely ever need to access widget->window. An execption
is for example when you are writing a custom widget and need to draw
on the GdkWindow. However you must only ever draw in an expose_event
handler anyway and widget->window will be valid then. If you need to
access the window member outside an event handler (you may for example
want to set a cursor), then you should connect to the "realize" signal
or the "configure" event. The window will have been created when these
signals are emitted.


Sven



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