34 lines
941 B
PHP
34 lines
941 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
|
|
use PHPNative\Framework\Application;
|
|
use PHPNative\Ui\Widget\TextArea;
|
|
use PHPNative\Ui\Window;
|
|
|
|
$app = new Application();
|
|
$window = new Window('TextArea Scroll Test', 800, 600);
|
|
|
|
// Root container: nur Hintergrund, TextArea soll den ganzen Bereich nutzen
|
|
$root = new \PHPNative\Ui\Widget\Container('bg-gray-100');
|
|
|
|
// Viel Text erzeugen
|
|
$lines = [];
|
|
for ($i = 1; $i <= 200; $i++) {
|
|
$lines[] = sprintf('Zeile %03d: Dies ist eine Testzeile zum Scrollen in der TextArea.', $i);
|
|
}
|
|
$longText = implode("\n", $lines);
|
|
|
|
$textArea = new TextArea($longText, 'Scroll-Test', 'w-full h-full border border-gray-300 bg-white text-black font-mono text-sm');
|
|
|
|
// Optional: kein Texture-Cache, damit Änderungen sofort sichtbar sind
|
|
$textArea->setUseTextureCache(false);
|
|
|
|
$root->addComponent($textArea);
|
|
|
|
$window->setRoot($root);
|
|
$app->addWindow($window);
|
|
$app->run();
|