refactor: add focus/unfocus to widget vtable
This commit is contained in:
parent
70cc191c4a
commit
3437f4fd20
3 changed files with 42 additions and 0 deletions
|
|
@ -100,3 +100,11 @@ pub fn walk(self: *Self, walk_ctx: *anyopaque, f: Widget.WalkFn) bool {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
pub fn focus(self: *Self) void {
|
||||
for (self.widgets.items) |*w| w.widget.focus();
|
||||
}
|
||||
|
||||
pub fn unfocus(self: *Self) void {
|
||||
for (self.widgets.items) |*w| w.widget.unfocus();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue