mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
add onChanged event
This commit is contained in:
parent
27da36d0f8
commit
2322d1f4aa
3 changed files with 22 additions and 11 deletions
|
|
@ -66,6 +66,17 @@ abstract class Entry
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->gtk->connect(
|
||||||
|
'changed',
|
||||||
|
function (
|
||||||
|
\GtkEntry $entry
|
||||||
|
) {
|
||||||
|
$this->_onChanged(
|
||||||
|
$entry
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract protected function _onActivate(
|
abstract protected function _onActivate(
|
||||||
|
|
@ -77,6 +88,10 @@ abstract class Entry
|
||||||
\GdkEvent $event
|
\GdkEvent $event
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
|
abstract protected function _onChanged(
|
||||||
|
\GtkEntry $entry
|
||||||
|
): void;
|
||||||
|
|
||||||
public function setLength(
|
public function setLength(
|
||||||
?int $value = null
|
?int $value = null
|
||||||
): void
|
): void
|
||||||
|
|
|
||||||
|
|
@ -29,19 +29,10 @@ class Request extends \Yggverse\Yoda\Abstract\Entity\Browser\Container\Page\Navb
|
||||||
$this->navbar->page->container->tab->updateSession();
|
$this->navbar->page->container->tab->updateSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update setter with session update feature
|
protected function _onChanged(
|
||||||
public function setValue(
|
\GtkEntry $entry
|
||||||
?string $value = null
|
|
||||||
): void
|
): void
|
||||||
{
|
{
|
||||||
$this->gtk->set_text(
|
|
||||||
is_null($value) ? $this->_value : trim(
|
|
||||||
strval(
|
|
||||||
$value
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Update session on tab initiated only
|
// Update session on tab initiated only
|
||||||
if (isset($this->navbar->page->container->tab))
|
if (isset($this->navbar->page->container->tab))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,11 @@ class Query extends \Yggverse\Yoda\Abstract\Entity\Entry
|
||||||
$this->response->refresh();
|
$this->response->refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function _onChanged(
|
||||||
|
\GtkEntry $entry
|
||||||
|
): void
|
||||||
|
{}
|
||||||
|
|
||||||
public function refresh(): void
|
public function refresh(): void
|
||||||
{
|
{
|
||||||
// @TODO
|
// @TODO
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue