Draw on the root window?



Hi all,

I'm trying to draw several widgets on the root window.
I've been trying to get this to work for a while now. Someone pointed me (and I seem to end up everytime) at this thread:
http://mail.gnome.org/archives/gtk-list/2000-August/msg00227.html

However that seems to be gtk+ 1.x related. I've tried to modify the code to work with gtk+ 2.x, but all it seems to do right now is draw all the widgets in a seperate window (managed seperately by the window manager and they won't even accept input properly)

Currently the code looks like this:

  // Create the window
  GdkWindow *gdkRootWindow = gdk_get_default_root_window();
  topLevelWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
  gtk_widget_realize(topLevelWindow);
  gdk_window_unref(topLevelWindow->window);
  topLevelWindow->window = gdk_window_ref(gdkRootWindow);
  gdk_window_set_user_data(gdkRootWindow, browser->topLevelWindow);

  // Create the other widgets
  topLevelVBox = gtk_vbox_new(FALSE, 0);
  gtk_container_add(GTK_CONTAINER(topLevelWindow), topLevelVBox);
  ...

As said above this doesn't seem to work. The thread mentioned above also includes some calls to catch expose events, I probably don't need those though, I want to have it act like a normal window.

Help would really be appreciated, I've looked all over but I have no idea how to do it. :)

 -- G-LiTe




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