コード例 #1
0
ファイル: class_knj_popup.php プロジェクト: kaspernj/knjphpfw
		/** The constructor of knj_popup. */
		function __construct($menu_items, $connect){
			parent::__construct();
			
			$this->connect_info = $connect;
			foreach($menu_items AS $key => $value){
				if (!is_array($value)){
					$value = array(
						"type" => "menuitem",
						"text" => $value
					);
				}
				
				if ($value["type"] == "menuitem"){
					$this->opt[$key] = new GtkMenuItem($value["text"]);
					$this->opt[$key]->connect("activate", array($this, "ItemActivate"), $key);
				}elseif($value["type"] == "checkitem"){
					$this->opt[$key] = new GtkCheckMenuItem($value["text"], false);
					
					if ($value["active"]){
						$this->opt[$key]->set_active(true);
					}
					
					$this->opt[$key]->connect("toggled", array($this, "CheckActivate"), $key);
				}
				
				$this->append($this->opt[$key]);
			}
			
			$this->show_all();
			$this->popup(null, null, null, 1);
		}
コード例 #2
0
ファイル: TMenu.class.php プロジェクト: enieber/adianti
 /**
  * Class Constructor
  * @param $xml SimpleXMLElement parsed from XML Menu
  */
 public function __construct($xml)
 {
     parent::__construct();
     $this->items = array();
     if ($xml instanceof SimpleXMLElement) {
         $this->parse($xml);
     }
 }
コード例 #3
0
 /**
  * @name __construct()
  * @return $GtkMenu
  */
 public function __construct()
 {
     parent::__construct();
 }