mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
export entire TextView widget reference to the Search component
This commit is contained in:
parent
e0cb5d7a0f
commit
8b65df99f4
8 changed files with 52 additions and 43 deletions
|
|
@ -1,25 +0,0 @@
|
|||
mod tag;
|
||||
|
||||
use tag::Tag;
|
||||
|
||||
use gtk::{prelude::TextBufferExt, TextBuffer};
|
||||
|
||||
pub struct Buffer {
|
||||
pub text_buffer: TextBuffer,
|
||||
pub tag: Tag,
|
||||
}
|
||||
|
||||
impl Buffer {
|
||||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn new(text_buffer: TextBuffer) -> Self {
|
||||
// Init components
|
||||
// * create new tag objects required for new buffer,
|
||||
// instead of re-use existing refs (maybe the bug)
|
||||
let tag = Tag::new(text_buffer.tag_table());
|
||||
|
||||
// Init `Self`
|
||||
Self { text_buffer, tag }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue