Browse Source

parent-window-handle

David Rose 16 years ago
parent
commit
c77097dd09

+ 7 - 0
panda/src/display/config_display.cxx

@@ -283,6 +283,13 @@ ConfigVariableEnum<WindowProperties::ZOrder> z_order
 ConfigVariableString window_title
 ConfigVariableString window_title
 ("window-title", "Panda");
 ("window-title", "Panda");
 
 
+ConfigVariableInt parent_window_handle
+("parent-window-title", 0,
+ PRC_DESC("The window handle of the parent window to attach the Panda window "
+          "to, for the purposes of creating an embedded window.  This is "
+          "an HWND on Windows, or the NSWindow pointer or XWindow pointer "
+          "converted to an integer, on OSX and X11."));
+
 ConfigVariableString framebuffer_mode
 ConfigVariableString framebuffer_mode
 ("framebuffer-mode", "",
 ("framebuffer-mode", "",
  PRC_DESC("No longer has any effect.  Do not use."));
  PRC_DESC("No longer has any effect.  Do not use."));

+ 1 - 0
panda/src/display/config_display.h

@@ -72,6 +72,7 @@ extern EXPCL_PANDA_DISPLAY ConfigVariableFilename icon_filename;
 extern EXPCL_PANDA_DISPLAY ConfigVariableFilename cursor_filename;
 extern EXPCL_PANDA_DISPLAY ConfigVariableFilename cursor_filename;
 extern EXPCL_PANDA_DISPLAY ConfigVariableEnum<WindowProperties::ZOrder> z_order;
 extern EXPCL_PANDA_DISPLAY ConfigVariableEnum<WindowProperties::ZOrder> z_order;
 extern EXPCL_PANDA_DISPLAY ConfigVariableString window_title;
 extern EXPCL_PANDA_DISPLAY ConfigVariableString window_title;
+extern EXPCL_PANDA_DISPLAY ConfigVariableInt parent_window_handle;
 
 
 extern EXPCL_PANDA_DISPLAY ConfigVariableString framebuffer_mode;
 extern EXPCL_PANDA_DISPLAY ConfigVariableString framebuffer_mode;
 extern EXPCL_PANDA_DISPLAY ConfigVariableBool framebuffer_hardware;
 extern EXPCL_PANDA_DISPLAY ConfigVariableBool framebuffer_hardware;

+ 3 - 0
panda/src/display/windowProperties.cxx

@@ -83,6 +83,9 @@ get_default() {
     props.set_z_order(z_order);
     props.set_z_order(z_order);
   }
   }
   props.set_title(window_title);
   props.set_title(window_title);
+  if (parent_window_handle.get_value() != 0) {
+    props.set_parent_window(parent_window_handle);
+  }
   props.set_mouse_mode(M_absolute);
   props.set_mouse_mode(M_absolute);
   return props;
   return props;
 }
 }