-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hello,
My attempt to answer the question :
define("g_signal_id", 0);// hack to assign dynamic value to invariant const ZOOMED
class MyObject extends GObject {
/**
* @g_signal_new("zoomed",
* self,
* G_SIGNAL_RUN_LAST,
* NULL, NULL, NULL,
* G_TYPE_INT, 1, G_TYPE_INT)
*/
const ZOOMED = g_signal_id;// internal hack : change constant ZOOMED value
protected $zoom = 100;
function setZoom($value) {
$this->zoom = $value;
g_signal_emit($this, self::ZOOMED, 0, $ret);
}
}
$object = new MyObject();
g_object_connect($object, "signal::zoomed", function(int):int{ echo "callback"; return 0;}, NULL, NULL);
//g_signal_connect($object, "zoomed", function(int):int{ echo "callback"; return 0;}, NULL);
$object->setZoom(51);Output:
callback
What do you think ?
Metadata
Metadata
Assignees
Labels
No labels