简体   繁体   English

获取具有焦点优先于当前关键焦点的clutter_actor的clutter_actor

[英]Get the clutter_actor having key focus previous to the currently key focused clutter_actor

Is there a way i can get the previously key focused actor. 有没有办法让我获得以前重点关注的演员。 because when i destroy the current key focused actor , i am not able to call the callback function when i press the keys. 因为当我销毁当前专注于键的actor时,按下键时我无法调用回调函数。 Is there anyway i can focus on the previous actor. 无论如何,我可以专注于前一个演员。

You are going to need some kind of "focus manager" on the stage to keep a stack of the actors that have obtained the focus. 在舞台上,您将需要某种“焦点管理器”,以保持一堆已经获得焦点的演员。

The manager can monitor the "key-focus" property on the stage. 管理者可以监视舞台上的“关键焦点”属性。 It then must connect to the "destroy" signal on the actors to prune items from the stack when they are no longer valid. 然后,它必须连接到actor上的“ destroy”信号,以在堆栈不再有效时从堆栈中删减它们。

When the focused actor is destroyed simply get the next actor in the stack (this will still be valid provided you prune items from the stack upon the destroy signal.) 当聚焦的actor被销毁时,只需将下一个actor移到堆栈中即可(只要您根据销毁信号从堆栈中删除项目,此行为仍然有效)。

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

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