init
This commit is contained in:
14
dev/click.sh
Executable file
14
dev/click.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# Simuliert einen Klick in der nested Shell: dev/click.sh x y
|
||||
# Ermittelt den Actor an der Position wie bei einem echten Klick (Picking) und löst den
|
||||
# nächstliegenden St.Button aus. Gibt den getroffenen Actor aus.
|
||||
DIR=$(cd "$(dirname "$0")" && pwd)
|
||||
"$DIR/eval.sh" "const Clutter = imports.gi.Clutter, St = imports.gi.St;
|
||||
let actor = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, $1, $2);
|
||||
const hit = actor ? actor.constructor.name + ' [' + (actor.style_class ?? '') + ']' : 'nichts';
|
||||
while (actor && !(actor instanceof St.Button))
|
||||
actor = actor.get_parent();
|
||||
if (actor)
|
||||
actor.emit('clicked', 1);
|
||||
hit + (actor ? ' -> clicked ' + actor.constructor.name + ' [' + actor.style_class + ']' : ' -> kein Button');
|
||||
"
|
||||
Reference in New Issue
Block a user