Struct fltk::text::TextBuffer [−][src]
pub struct TextBuffer { /* fields omitted */ }
Expand description
Wraps a text buffer, Cloning a text buffer invalidates the underlying pointer, thus the no derive(Clone)
Implementations
impl TextBuffer
[src]
impl TextBuffer
[src]pub fn default() -> TextBuffer
[src]
pub fn default() -> TextBuffer
[src]Initialized a default text buffer
pub unsafe fn delete(buf: Self)
[src]
pub unsafe fn delete(buf: Self)
[src]Deletes the TextBuffer
Safety
The buffer shouldn’t be deleted while the Display widget still needs it
pub unsafe fn delete_buffer(buf: TextBuffer)
[src]
pub unsafe fn delete_buffer(buf: TextBuffer)
[src]Deletes the TextBuffer
Safety
The buffer shouldn’t be deleted while the Display widget still needs it
pub unsafe fn from_ptr(ptr: *mut Fl_Text_Buffer) -> Self
[src]
pub unsafe fn from_ptr(ptr: *mut Fl_Text_Buffer) -> Self
[src]pub unsafe fn as_ptr(&self) -> *mut Fl_Text_Buffer
[src]
pub unsafe fn as_ptr(&self) -> *mut Fl_Text_Buffer
[src]Returns the inner pointer from a text buffer
Safety
Can return multiple mutable pointers to the same buffer
pub fn append(&mut self, text: &str)
[src]
pub fn append(&mut self, text: &str)
[src]Appends to the buffer. To append and scroll to the end of the buffer:
use fltk::{prelude::*, *}; let txt = "Some long text!"; let buf = text::TextBuffer::default(); let mut disp = text::TextDisplay::default(); disp.set_buffer(Some(buf)); disp.buffer().unwrap().append(txt); disp.set_insert_position(disp.buffer().unwrap().length()); disp.scroll( disp.count_lines(0, disp.buffer().unwrap().length(), true), 0, );
pub fn text_range(&self, start: i32, end: i32) -> Option<String>
[src]
pub fn text_range(&self, start: i32, end: i32) -> Option<String>
[src]Returns the text within the range
pub fn replace(&mut self, start: i32, end: i32, text: &str)
[src]
pub fn replace(&mut self, start: i32, end: i32, text: &str)
[src]Replaces text from position start
to end
pub fn copy_from(
&mut self,
source_buf: &TextBuffer,
start: i32,
end: i32,
to: i32
)
[src]
pub fn copy_from(
&mut self,
source_buf: &TextBuffer,
start: i32,
end: i32,
to: i32
)
[src]Copies text from a source buffer into the current buffer
pub fn copy(&self) -> TextBuffer
[src]
pub fn copy(&self) -> TextBuffer
[src]Copies whole text from a source buffer into a new buffer
pub fn tab_distance(&self) -> i32
[src]
pub fn tab_distance(&self) -> i32
[src]Returns the tab distance for the buffer
pub fn set_tab_distance(&mut self, tab_dist: i32)
[src]
pub fn set_tab_distance(&mut self, tab_dist: i32)
[src]Sets the tab distance
pub fn selection_text(&mut self) -> String
[src]
pub fn selection_text(&mut self) -> String
[src]Returns the selection text
pub fn remove_selection(&mut self)
[src]
pub fn remove_selection(&mut self)
[src]Removes the selection
pub fn replace_selection(&mut self, text: &str)
[src]
pub fn replace_selection(&mut self, text: &str)
[src]Replaces selection
pub fn is_highlighted(&mut self) -> bool
[src]
pub fn is_highlighted(&mut self) -> bool
[src]Returns whether text is highlighted
pub fn unhighlight(&mut self)
[src]
pub fn unhighlight(&mut self)
[src]Unhighlights text
pub fn highlight_text(&mut self) -> String
[src]
pub fn highlight_text(&mut self) -> String
[src]Returns the highlighted text
pub fn line_start(&self, pos: i32) -> i32
[src]
pub fn line_start(&self, pos: i32) -> i32
[src]Returns the index of the line’s start position at pos
pub fn word_start(&self, pos: i32) -> i32
[src]
pub fn word_start(&self, pos: i32) -> i32
[src]Returns the index of the first character of a word at pos
pub fn word_end(&self, pos: i32) -> i32
[src]
pub fn word_end(&self, pos: i32) -> i32
[src]Returns the index of the last character of a word at pos
pub fn count_lines(&self, start: i32, end: i32) -> i32
[src]
pub fn count_lines(&self, start: i32, end: i32) -> i32
[src]Counts the lines from start to end
pub fn call_modify_callbacks(&mut self)
[src]
pub fn call_modify_callbacks(&mut self)
[src]Calls the modify callbacks
Trait Implementations
impl Clone for TextBuffer
[src]
impl Clone for TextBuffer
[src]fn clone(&self) -> TextBuffer
[src]
fn clone(&self) -> TextBuffer
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for TextBuffer
[src]
impl Debug for TextBuffer
[src]impl Drop for TextBuffer
[src]
impl Drop for TextBuffer
[src]impl Send for TextBuffer
[src]
impl Sync for TextBuffer
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more