<?php
if( !extension_loaded('gtk')) {
dl( 'php_gtk.' . PHP_SHLIB_SUFFIX);
}
$window = &new GtkWindow();
$window->set_title( 'tooltip window');
$window->set_default_size( 200, 200);
$window->connect_object('destroy', array('gtk', 'main_quit'));
$vbox = &new GtkVBox();
$btnSparkum = &new GtkButton( 'OEffnen');
$btnNaclus = &new GtkButton( 'Speichern');
$label = &new GtkLabel( 'Normal label');
$labelEvent = &new GtkLabel( 'Label on EventBox');
$eventbox = &new GtkEventBox();
$eventbox->add( $labelEvent);
$vbox->pack_start_defaults( $btnSparkum);
$vbox->pack_start_defaults( $btnNaclus);
$vbox->pack_start_defaults( $label);
$vbox->pack_start_defaults( $eventbox);
$tooltips = &new GtkTooltips();
$tooltips->set_tip( $btnSparkum, 'OEffnen is german for "Open"',
"OEffnen is german for \"Open\"\r\nSee it as a way to extend\r\nyour knowledge");
$tooltips->set_tip( $btnNaclus, 'Speichern is german for "Save"',
"Speichern is german for \"Save\"\r\nSee it as a way to extend\r\nyour knowledge");
$tooltips->set_tip( $label, 'You shouldn\'t see this.', null);
$tooltips->set_tip( $eventbox, 'A tooltip on a label... magic.',
"No magic!\r\nYou just need to pack the label\r\non an EventBox.");
$window->add( $vbox);
$window->show_all();
gtk::main();
?>
|