mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 09:35:28 +00:00
add length/placeholder api methods
This commit is contained in:
parent
12a1473d8c
commit
e04da6cb19
1 changed files with 32 additions and 0 deletions
|
|
@ -66,6 +66,28 @@ abstract class Entry
|
||||||
\GdkEvent $event
|
\GdkEvent $event
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
|
public function setLength(
|
||||||
|
?int $value = null
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
$this->gtk->set_max_length(
|
||||||
|
is_null($value) ? $this->_length : $value
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setPlaceholder(
|
||||||
|
?string $value = null
|
||||||
|
): void
|
||||||
|
{
|
||||||
|
$this->gtk->set_placeholder_text(
|
||||||
|
is_null($value) ? $this->_value : trim(
|
||||||
|
strval(
|
||||||
|
$value
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public function setValue(
|
public function setValue(
|
||||||
?string $value = null
|
?string $value = null
|
||||||
): void
|
): void
|
||||||
|
|
@ -79,6 +101,16 @@ abstract class Entry
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getLength(): ?int
|
||||||
|
{
|
||||||
|
return $this->gtk->get_max_length();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getPlaceholder(): ?string
|
||||||
|
{
|
||||||
|
return $this->gtk->get_placeholder_text();
|
||||||
|
}
|
||||||
|
|
||||||
public function getValue(): ?string
|
public function getValue(): ?string
|
||||||
{
|
{
|
||||||
return $this->gtk->get_text();
|
return $this->gtk->get_text();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue