0

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.

user129975
  • 3,395
  • 4
  • 19
  • 16

1 Answers1

0

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 ;
}
Matt
  • 74,352
  • 26
  • 153
  • 180
user129975
  • 3,395
  • 4
  • 19
  • 16