PHP-GTK.eu End of Life and GDPR

If you're reading the PHP-GTK.eu community site these days, you certainly noticed that not a single piece of significant content was created since 2015, and not much since 2013.

Whatever this may mean for PHP-GTK itself is another issue, but for the site itself, it means it ceased to be relevant about 5 years ago, and it's time to move on for the site members. Since the site contains non-anonymous user, it will fall under the new EU GDPR regulations entering into force on 2018-05-25, and there is no point for me to spend time on evolving the site towards compliance when no one is actually using it.

So here is the EOL announcement: the site will be shutting down on 2018-05-24 and its data will taken offline.

A static version of the articles may be published again at some point here or elsewhere, but I wouldn't hold my breath on it. So if you have even some interest in the site content, be sure to copy/paste the pages of interest before it goes dark on 2018-05-24. Or contact me if you want a copy of the files and content, or check my blog for newer content.

Thanks all for participating, it's been a pleasure while it lasted.

FGM

Call Function Within Class Using Gtk::timeout_add();

Hello,
Calling a function on a repetitive basis is simple enough using something like:
Gtk::timeout_add(200, 'subtract'); //call subtract() 5 times per second

However, how would I call subtract() if it is within a class? Example:

<?php
class CoolClass {
    private
$clickInt = 0;
   
    function
subtract() {
       
$this->clickInt--;
                return
true;
    }
}

/* //I don't want to call the class function like this, or do I need to?
function subtract() {
    global $coolClassInstance;
    $coolClassInstance->subtract();
    return true;
}
*/

$coolClassInstance = new CoolClass();

$timeoutID = Gtk::timeout_add(200, 'subtract'); //how to call $coolClassInstance->subtract()?

Gtk::main();
?>

Thanks much for the help :)

with an array

You use an array to pass the reference of the class, and the name of the method to call. PHP-GTK takes care of the rest.

<?php
$timeoutID
= Gtk::timeout_add(200, array($coolClassInstance, 'subtract'));
?>

Thank you much for the

Thank you much for the clarification. It works great! Also thank you "Fosfor" and you on the #php-gtk irc chat channel for initial discussion on this topic.

Options d'affichage des commentaires

Sélectionnez la méthode d'affichage des commentaires que vous préférez, puis cliquez sur "Sauvegarder les paramètres" pour activer vos changements.