╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ widget.zig ───────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
1876 fn selector(self: *CopyableText, index: usize) *wgt.TextBox { 1877 return &self.box.children.values()[index].widget.text_box; 1878 } 1879 1880 fn maxWidth(choices: []const Choice) usize { 1881 var width: usize = 0; 1882 for (choices) |choice| width = @max(width, choice.text.len, choice.label.len, choice.bottom_label.len); 1883 return width; 1884 } 1885 1886 pub fn clearGrid(self: *CopyableText) void { 1887 self.box.clearGrid(); 1888 } 1889 1890 pub fn getGrid(self: CopyableText) ?Grid { 1891 return self.box.getGrid(); 1892 } 1893 1894 pub fn getFocus(self: *CopyableText) *Focus { 1895 return self.box.getFocus(); 1896 } 1897 }; 1898