简体   繁体   中英

How to set the position of stage or window using clutter1.0?

How to set the position of the stage or window using clutter1.0? Just like in opengl glutInitWindowPosition(0, 500) . Thanks...

Clutter does not provide a wrapper around windowing system specific API: the Stage, as a scene graph element, is defined to always be at (0, 0), so you cannot use the ClutterActor set_position() method on it.

if you're on X11, you can use the X11 API to move a stage Window, eg:


  Display *xdpy = clutter_x11_get_default_display ();
  Window xwin = clutter_x11_stage_get_window (stage);

  XMoveWindow (xdpy, xwin, 0, 500);

obviously, there's the whole thorny issue of manual window placement in X11: you should not really do that, and you should defer to the window manager to actually position your windows.

on Windows, you can get the WHND of the Stage window using clutter_win32_get_stage_window() and use SetWindowPos() similarly to how it works on X11.

on OS X is a bit trickier, as Clutter does not expose the NSWindow nor the NSView used by the Stage, as of yet, so you'll have to hack a bit inside Clutter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM