pub unsafe trait BrowserExt: WidgetExt {
Show 48 methods
// Required methods
fn remove(&mut self, line: i32);
fn add(&mut self, item: &str);
fn add_with_data<T: Clone + 'static>(&mut self, item: &str, data: T);
fn insert(&mut self, line: i32, item: &str);
fn insert_with_data<T: Clone + 'static>(
&mut self,
line: i32,
item: &str,
data: T,
);
fn move_item(&mut self, to: i32, from: i32);
fn swap(&mut self, a: i32, b: i32);
fn clear(&mut self);
fn size(&self) -> i32;
fn select(&mut self, line: i32);
fn deselect(&mut self, line: i32);
fn selected(&self, line: i32) -> bool;
fn text(&self, line: i32) -> Option<String>;
fn selected_text(&self) -> Option<String>;
fn set_text(&mut self, line: i32, txt: &str);
fn load<P: AsRef<Path>>(&mut self, path: P) -> Result<(), FltkError>;
fn text_size(&self) -> i32;
fn set_text_size(&mut self, sz: i32);
fn set_icon<Img: ImageExt>(&mut self, line: i32, image: Option<Img>);
fn icon(&self, line: i32) -> Option<Box<dyn ImageExt>>;
fn remove_icon(&mut self, line: i32);
fn top_line(&mut self, line: i32);
fn bottom_line(&mut self, line: i32);
fn middle_line(&mut self, line: i32);
fn format_char(&self) -> char;
fn set_format_char(&mut self, c: char);
fn column_char(&self) -> char;
fn set_column_char(&mut self, c: char);
fn column_widths(&self) -> Vec<i32>;
fn set_column_widths(&mut self, arr: &[i32]);
fn displayed(&self, line: i32) -> bool;
fn make_visible(&mut self, line: i32);
fn vposition(&self) -> i32;
fn set_vposition(&mut self, pos: i32);
fn hposition(&self) -> i32;
fn set_hposition(&mut self, pos: i32);
fn has_scrollbar(&self) -> BrowserScrollbar;
fn set_has_scrollbar(&mut self, mode: BrowserScrollbar);
fn scrollbar_size(&self) -> i32;
fn set_scrollbar_size(&mut self, new_size: i32);
fn sort(&mut self);
fn scrollbar(&self) -> Scrollbar;
fn hscrollbar(&self) -> Scrollbar;
fn value(&self) -> i32;
fn set_data<T: Clone + 'static>(&mut self, line: i32, data: T);
unsafe fn data<T: Clone + 'static>(&self, line: i32) -> Option<T>;
fn hide_line(&mut self, line: i32);
fn selected_items(&self) -> Vec<i32>;
}
Expand description
Defines the methods implemented by all browser types More info can be found in the wiki
§Safety
fltk-rs traits depend on some FLTK internal code
§Warning
fltk-rs traits are non-exhaustive,
to avoid future breakage if you try to implement them manually,
use the Deref and DerefMut
pattern or the widget_extends!
macro
Required Methods§
Sourcefn add_with_data<T: Clone + 'static>(&mut self, item: &str, data: T)
fn add_with_data<T: Clone + 'static>(&mut self, item: &str, data: T)
Adds an item with associated data
Sourcefn insert_with_data<T: Clone + 'static>(
&mut self,
line: i32,
item: &str,
data: T,
)
fn insert_with_data<T: Clone + 'static>( &mut self, line: i32, item: &str, data: T, )
Inserts an item at an index with associated data. Lines start at 1
Sourcefn text(&self, line: i32) -> Option<String>
fn text(&self, line: i32) -> Option<String>
Returns the text of the item at line
.
Lines start at 1
Sourcefn selected_text(&self) -> Option<String>
fn selected_text(&self) -> Option<String>
Returns the text of the selected item. Lines start at 1
Sourcefn set_text(&mut self, line: i32, txt: &str)
fn set_text(&mut self, line: i32, txt: &str)
Sets the text of the selected item. Lines start at 1
Sourcefn set_text_size(&mut self, sz: i32)
fn set_text_size(&mut self, sz: i32)
Sets the text size. Lines start at 1
Sourcefn set_icon<Img: ImageExt>(&mut self, line: i32, image: Option<Img>)
fn set_icon<Img: ImageExt>(&mut self, line: i32, image: Option<Img>)
Sets the icon for browser elements. Lines start at 1
Sourcefn icon(&self, line: i32) -> Option<Box<dyn ImageExt>>
fn icon(&self, line: i32) -> Option<Box<dyn ImageExt>>
Returns the icon of a browser element. Lines start at 1
Sourcefn remove_icon(&mut self, line: i32)
fn remove_icon(&mut self, line: i32)
Removes the icon of a browser element. Lines start at 1
Sourcefn top_line(&mut self, line: i32)
fn top_line(&mut self, line: i32)
Scrolls the browser so the top item in the browser is showing the specified line. Lines start at 1
Sourcefn bottom_line(&mut self, line: i32)
fn bottom_line(&mut self, line: i32)
Scrolls the browser so the bottom item in the browser is showing the specified line. Lines start at 1
Sourcefn middle_line(&mut self, line: i32)
fn middle_line(&mut self, line: i32)
Scrolls the browser so the middle item in the browser is showing the specified line. Lines start at 1
Sourcefn format_char(&self) -> char
fn format_char(&self) -> char
Gets the current format code prefix character, which by default is ‘@’. More info here
Sourcefn set_format_char(&mut self, c: char)
fn set_format_char(&mut self, c: char)
Sets the current format code prefix character to \p c. The default prefix is ‘@’. c should be ascii
Sourcefn column_char(&self) -> char
fn column_char(&self) -> char
Gets the current column separator character. The default is ‘\t’
Sourcefn set_column_char(&mut self, c: char)
fn set_column_char(&mut self, c: char)
Sets the column separator to c. This will only have an effect if you also use set_column_widths()
.
c should be ascii
Sourcefn column_widths(&self) -> Vec<i32>
fn column_widths(&self) -> Vec<i32>
Gets the current column width array
Sourcefn set_column_widths(&mut self, arr: &[i32])
fn set_column_widths(&mut self, arr: &[i32])
Sets the current column width array
Sourcefn make_visible(&mut self, line: i32)
fn make_visible(&mut self, line: i32)
Makes a specified line visible
Sourcefn set_vposition(&mut self, pos: i32)
fn set_vposition(&mut self, pos: i32)
Sets the vertical scroll position of the list as a pixel position
Sourcefn set_hposition(&mut self, pos: i32)
fn set_hposition(&mut self, pos: i32)
Sets the horizontal scroll position of the list as a pixel position
Sourcefn has_scrollbar(&self) -> BrowserScrollbar
fn has_scrollbar(&self) -> BrowserScrollbar
Returns the type of scrollbar associated with the browser
Sourcefn set_has_scrollbar(&mut self, mode: BrowserScrollbar)
fn set_has_scrollbar(&mut self, mode: BrowserScrollbar)
Sets the type of scrollbar associated with the browser
Sourcefn scrollbar_size(&self) -> i32
fn scrollbar_size(&self) -> i32
Gets the scrollbar size
Sourcefn set_scrollbar_size(&mut self, new_size: i32)
fn set_scrollbar_size(&mut self, new_size: i32)
Sets the scrollbar size
Sourcefn hscrollbar(&self) -> Scrollbar
fn hscrollbar(&self) -> Scrollbar
Returns the horizontal scrollbar
Sourcefn set_data<T: Clone + 'static>(&mut self, line: i32, data: T)
fn set_data<T: Clone + 'static>(&mut self, line: i32, data: T)
Set the data associated with the line
Sourcefn selected_items(&self) -> Vec<i32>
fn selected_items(&self) -> Vec<i32>
Gets the selected items
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.