duankan8739 2009-11-20 20:14
浏览 45

如何在PHP-GTK2中找到GTK版本?

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.

  • 写回答

1条回答 默认 最新

  • duanjing9739 2009-11-20 21:02
    关注

    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 ;
    }
    
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度