feat(buffers): add support for ephemeral buffers
Ephemeral buffers are not hidden and kept when closed. Ephemeral buffers can be turned into regular buffers by saving them with save_as.
This commit is contained in:
parent
8062923068
commit
939537ed84
7 changed files with 92 additions and 18 deletions
|
@ -82,6 +82,11 @@ pub fn State(ctx_type: type) type {
|
|||
allocator.destroy(self);
|
||||
}
|
||||
|
||||
pub fn update_label(self: *Self, label: []const u8) error{OutOfMemory}!void {
|
||||
self.allocator.free(self.opts.label);
|
||||
self.opts.label = try self.allocator.dupe(u8, label);
|
||||
}
|
||||
|
||||
pub fn layout(self: *Self) Widget.Layout {
|
||||
return self.opts.on_layout(&self.opts.ctx, self);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue