34 lines
743 B
PHP
34 lines
743 B
PHP
<?php
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use PHPNative\Framework\Application;
|
|
use PHPNative\Ui\Widget\Container;
|
|
use PHPNative\Ui\Widget\Label;
|
|
use PHPNative\Ui\Window;
|
|
|
|
define('DEBUG_RENDERING', true);
|
|
|
|
$app = new Application();
|
|
$window = new Window('Simple Container with Label', 600, 400);
|
|
|
|
// Main container
|
|
$mainContainer = new Container('p-4 bg-gray-100');
|
|
|
|
$label = new Label(
|
|
text: 'Test',
|
|
style: 'text-xl m-4 bg-lime-400 p-4',
|
|
);
|
|
|
|
$mainContainer->addComponent($label);
|
|
|
|
$window->setRoot($mainContainer);
|
|
$app->addWindow($window);
|
|
|
|
echo "TextInput Test started!\n";
|
|
echo "- Red container (80px)\n";
|
|
echo "- Blue container with TextInput and Button (40px)\n";
|
|
echo "- Green container (80px)\n\n";
|
|
|
|
$app->run();
|