| ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot |
GladeXML Constructor GladeXML (string fname, [string root = NULL, [string domain = NULL]]);
Creates a new instance of the glade class, based on a glade file fname. If you want to load the whole glade file, you can omit the root parameter. For loading only a part of the file, e.g. the menu definition, you can pass the name of the wished root element. In the example we could use "btnClose" to load the close button only. If the button had subwidgets, they would be loaded as well. When using the GNU Gettext module for internationalization, you can specifiy the gettext domain as third parameter. Glade will translate all the properties marked with "translatable" via the gettext functions on this domain. The following two files result in a sample application which loads the glade file and connect the button's "clicked" signal to exit the application. You don't need to call the show() and realize() functions as glade takes care of this. 例 64. Basic application which loads a glade file
例 65. Basic glade file "hellowg.glade"
When defining more than one window in the glade file,
all windows are shown when loading it. You can set
the "Visible" property in glade to avoid this.
A small explanation of the code above: The glade code was automatically created with glade. The instantiation of the glade requires the filename as first parameter, and we use dirname( __FILE__) . '/hellow.glade' to make sure the glade file is loaded from the same location where the php script is located. If you would pass the filename without the parameter to the glade constructor, the glade file wouldn't be found if the program is run in a working directory which is not the directory of the php script. To let the application exit tidily, we connect the "destroy" signal of the window as normal; but before we get the widget via the get_widget() function. |
各種マニュアル:
PHPマニュアル |
PEARマニュアル |
Smarty(英語)マニュアル |
PHP-GTKマニュアル |
「GladeXML Constructor」をGoogle検索
|