Re: GDK "root" GtkObject?



On Thu, 17 Aug 2000, Derek Simkowiak wrote:

 Hi, 

> 
>      Hello,
> 	I'm looking to deal with expose events generated by the root
> ("desktop") window.  (I'm animating the background)
> 
> 	I can get the root GdkWindow by calling
> 
> window = GDK_ROOT_PARENT();
> 
> 	Now I want to grab expose events and handle them.  However, the
> only thing I could find is using gtk_signal_connect() on the GtkObject
> that owns the GdkWindow whose expose events you wish to grab.
> 
> 	So, my question is: Is there a GtkObject which owns the root
> window?  Or am I going about this in the wrong way?
> 

 I think you should do the following: get root gdk window using
GDK_ROOT_PARENT(), then simpulate creation of GtkWindow from that gdk_window
(see gtkwindow.c) - i.e. set all flags appropriately (mark it as mapped,
visible, etc) - gtk_window_new() and setting the gdk window and marking it as 
realized should be enough IMO. After that you will have to
gdk_window_set_events(root,GDK_EXPOSURE_MASK) to make it accepting exposures. 
That's all.
 
 Please report whether this worked.

> Thanks,
> Derek Simkowiak
> dereks@kd-dev.com
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 

 Best regards,
  -Vlad






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