tags:

views:

44

answers:

1

This one is driving me nuts. According to GTK's site, there exists GTK_MAJOR_VERSION, GTK_MINOR_VERSION, and GTK_MICRO_VERSION constants. However, none of these work:

echo GTK_MAJOR_VERSION; echo GtK::MAJOR_VERISON; echo Gtk::GTK_MAJOR_VERSION; etc

Also, Gtk::check_version(2,12,0) always fails even though I have a higher version.

I'd like to simply get the actual version number and not rely on check_version, which seems unreliable.

How can I do this? I need to do it within PHP, platform independent.

A: 

Found a code example:

static public function GetGtkVersion()
{
        $sVersion = Gtk::get_version() ;
        $sVersion = str_replace('Gtk','',$sVersion) ;
        $sVersion = str_replace('GTK','',$sVersion) ;
        $sVersion = trim($sVersion) ;

        list($nPriVer,$nSecVer,$nThdVer) = explode('.',$sVersion) ;
        $aVersion = array($nPriVer,$nSecVer,$nThdVer) ;
        return $aVersion ;
}

From: http://www.google.com/codesearch/p?hl=en&sa=N&cd=1&ct=rc#84rrsv6GVmw/trunk/Framework/Lib.php/MVC/MVC.Gtk/class.JCAT%5FGtk.php&q=gtk%20get%5Fversion%20lang%3Aphp