简体   繁体   English

如何使用clutter1.0设置舞台或窗口的位置?

[英]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? 如何使用clutter1.0设置舞台或窗口的位置? Just like in opengl glutInitWindowPosition(0, 500) . 就像在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. Clutter没有提供围绕窗口系统特定的API的包装器:舞台(作为场景图元素)被定义为始终位于(0,0),因此您不能在其上使用ClutterActor set_position()方法。

if you're on X11, you can use the X11 API to move a stage Window, eg: 如果您使用的是X11,则可以使用X11 API移动舞台Window,例如:


  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. 显然,X11中存在整个棘手的手动窗口放置问题:您不应该这样做,而应该让窗口管理器实际放置窗口。

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. 在Windows上,您可以使用clutter_win32_get_stage_window()来获取舞台窗口的WHND,并使用SetWindowPos()类似于在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. 在OS X上,它有点棘手,因为到目前为止,Clutter尚未公开舞台使用的NSWindow或NSView,因此您必须在Clutter中进行一些改动。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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