30 lines
740 B
PHP
30 lines
740 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use PHPNative\Framework\Application;
|
|
use PHPNative\Ui\Widget\Button;
|
|
use PHPNative\Ui\Widget\Container;
|
|
use PHPNative\Ui\Widget\Label;
|
|
use PHPNative\Ui\Window;
|
|
|
|
$app = new Application();
|
|
$window = new Window('Simple Test', 400, 300);
|
|
|
|
$container = new Container('flex flex-col p-4 gap-4');
|
|
|
|
$label = new Label('Test Label', 'text-lg');
|
|
$container->addComponent($label);
|
|
|
|
$button = new Button('Test Button', 'px-4 py-2 bg-blue-600 text-white rounded');
|
|
$button->setOnClick(function() use ($label) {
|
|
$label->setText('Button clicked!');
|
|
});
|
|
$container->addComponent($button);
|
|
|
|
$window->setRoot($container);
|
|
$app->addWindow($window);
|
|
|
|
echo "Simple test starting...\n";
|
|
$app->run();
|