Mailinglisten-Archive |
On Mon, 26 Mar 2001 19:12:57 +0200
Ralf Geschke <ralf at kuerbis.org> wrote:
> Frage: Hat jemand von Euch vielleicht ein PHP-Beispiel
> zum Aufbau von Menues, egal ob mit oder ohne Itemfactory?
> Funktioniert letztere ueberhaupt mit PHP?
>
> Momentan helfe ich mir mit Buttons zum Aufruf der verschiedenen
> Funktionalitaeten, aber auf Dauer ist das natuerlich nicht
> das Wahre.
<snip
source="http://marc.theaimsgroup.com/?l=php-gtk&m=98375263609533&w=2">
$window = &new GtkWindow();
$ag = &new GtkAccelGroup();
$itemf = &new GtkItemFactory(GtkMenuBar::get_type(), '<main>', $ag);
$window->add_accel_group($ag);
$itemf->create_items(array(
array('/_File', '', null, 0,
'<Branch>'),
array('/_File/_New', '<control>N', 'file_cb', 1,
''),
array('/_File/sep1', '', null, 0,
\
'<Separator>'),
array('/_File/E_xit', '<control>X', 'file_cb', 2,
'')));
$window->add($itemf->get_widget('<main>'));
The structure of each factory item is as follows:
* path
* accelerator binding
* callback (or null)
* callback action
(allows you to distinguish which item was * selected)
* item type
(see
http://developer.gnome.org/doc/API/gtk/gtkitemfactory.html#GTKITEMFACTORYENTRY
\
for possible values for this)
Hope this helps,
-Andrei
</snip>
Jan
--
php::bar PHP Wiki - Listenarchive