addItem('Neu', function () { echo "Neu clicked\n"; }); $fileMenu->addItem('Öffnen', function () { echo "Öffnen clicked\n"; }); $fileMenu->addSeparator(); $fileMenu->addItem('Beenden', function () use ($app) { echo "Beenden clicked\n"; exit(0); }); // Settings Menu $settingsMenu = new Menu(title: 'Einstellungen'); $settingsMenu->addItem('Optionen', function () { echo "Optionen clicked\n"; }); $settingsMenu->addItem('Sprache', function () { echo "Sprache clicked\n"; }); $menuBar->addMenu($fileMenu); $menuBar->addMenu($settingsMenu); $mainContainer->addComponent($menuBar); $statusBar = new StatusBar(); $statusLabel = new Label( text: 'Fenster: ' . $window->getViewport()->windowWidth . 'x' . $window->getViewport()->windowHeight, style: 'basis-2/8 text-black', ); $statusBar->addSegment($statusLabel); $statusBar->addSegment(new Label( text: 'Zeilen: 10', style: 'basis-4/8 text-black border-l', )); // Fixed width $statusBar->addSegment(new Label( text: 'Version 1.0', style: 'border-l text-black basis-2/8', )); $mainContainer->addComponent($statusBar); $window->setOnResize(function (Window $window) use (&$statusLabel) { $statusLabel->setText( 'Fenster: ' . $window->getViewport()->windowWidth . 'x' . $window->getViewport()->windowHeight, ); }); // Set root and run $window->setRoot($mainContainer); $app->addWindow($window); $app->run();