1.Creation
In PHP-GTK this is done by creating an object, e.g. $window =&new GtkWindow();
2.Placement
This is the step of adding a widget to a container. This isachieved most straightforwardly in PHP-GTK by using the syntax$container->add($widget);
3.Signal Connection
This is the step of setting up callback functions for use. Anexample of this might be $widget->connect("event","my_focus_func"); , where "event" is a predefined state such as"clicked" and "my_focus_func" is the called subroutine.
4.Display
This describes whether the widget is on display to the user. It isstarted by calling $widget->show(); and finished by$widget->hide();.
5.Destruction
This occurs when the gtk::main_quit() function is called. Allactions that are necessary here are handled internally.

1.建立
把類別實體化:$window=&new GtkWindow();
2.安排位置
把物件丟到容器(Container)內:$container->add($widget);
3.訊號連接
簡單的說..像是VB裡面,當我在物件上面點兩下後,可以選擇該物件的什麼事件被觸發..$widget->connect("event", "my_func");
4.顯示
程式設計師可以決定是否要將widget顯示在Screen上:
$widget->show(); //這是顯示
$widget->hide(); //這是隱藏
5.破壞
程式結束了,還要放在那邊佔記憶體嗎..?
$widget->destroy(); //一次砍一個
gtk::main_quit(); //一次全部釋放XD

hechian 發表在 痞客邦 留言(0) 人氣()