Questions about child windows



I have a couple of questions regarding child windows:

1) How can you set the child windows position relative to the parent window?
   (i.e centered in parent window)
	I've tried: (simple case ignoring parent window's width for now)

		gdk_window_get_position(parent_window, &x, &y);
		gtk_widget_set_uposition(child_window, &x + 300, &y + 300);

	The problem I'm having is that x, and y are not correct. I always
	get 16,0 no matter where the parent window is placed. (I was having
	problems with the set_uposition untill I made the child_window a 
	GTK_WNIDOW_DIALOG rather then TOPLEVEL. It seems the window manager
	overides the window position if it's TOPLEVEL.)

2) Once I open a child window is there a way to prevent the parent window
from responding to events untill the child window is closed? (similar to the
way netscape's preferences window prevents you from accessing the main window)



Thanks
-Tom Geiger



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