[−][src]Trait fltk::prelude::BrowserExt
Defines the methods implemented by all browser types
Required methods
fn remove(&mut self, line: u32)
Removes the specified line Lines start at 1
fn add(&mut self, item: &str)
Adds an item
fn insert(&mut self, line: u32, item: &str)
Inserts an item at an index Lines start at 1
fn move_item(&mut self, to: u32, from: u32)
Moves an item Lines start at 1
fn swap(&mut self, a: u32, b: u32)
Swaps 2 items Lines start at 1
fn clear(&mut self)
Clears the browser widget
fn size(&self) -> u32
Returns the number of items
fn set_size(&mut self, w: i32, h: i32)
Set the number of items
fn select(&mut self, line: u32)
Select an item at the specified line Lines start at 1
fn selected(&self, line: u32) -> bool
Returns whether the item is selected Lines start at 1
fn text(&self, line: u32) -> Option<String>
Returns the text of the selected item Lines start at 1
fn set_text(&mut self, line: u32, txt: &str)
Sets the text of the selected item Lines start at 1
fn load<P: AsRef<Path>>(&mut self, path: P) -> Result<(), FltkError>
Load a file
fn text_size(&self) -> u32
Return the text size
fn set_text_size(&mut self, sz: u32)
Sets the text size Lines start at 1
fn set_icon<Img: ImageExt>(&mut self, line: u32, image: Option<Img>)
Sets the icon for browser elements Lines start at 1
fn icon(&self, line: u32) -> Option<Image>
Returns the icon of a browser element Lines start at 1
fn remove_icon(&mut self, line: u32)
Removes the icon of a browser element Lines start at 1
fn topline(&mut self, line: u32)
Scrolls the browser so the top item in the browser is showing the specified line Lines start at 1
fn bottomline(&mut self, line: u32)
Scrolls the browser so the bottom item in the browser is showing the specified line Lines start at 1
fn middleline(&mut self, line: u32)
Scrolls the browser so the middle item in the browser is showing the specified line Lines start at 1
fn format_char(&self) -> char
Gets the current format code prefix character, which by default is '@' More info here: https://www.fltk.org/doc-1.3/classFl__Browser.html#a129dca59d64baf166503ba59341add69
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
fn column_char(&self) -> char
Gets the current column separator character. The default is '\t'
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
fn column_widths(&self) -> Vec<i32>
Gets the current column width array
fn set_column_widths(&mut self, arr: &'static [i32])
Sets the current column width array
fn displayed(&self, line: u32) -> bool
Returns whether a certain line is displayed
fn make_visible(&mut self, line: u32)
Makes a specified line visible
fn position(&self) -> u32
Gets the vertical scroll position of the list as a pixel position
fn set_position(&mut self, pos: u32)
Sets the vertical scroll position of the list as a pixel position
fn hposition(&self) -> u32
Gets the horizontal scroll position of the list as a pixel position
fn set_hposition(&mut self, pos: u32)
Sets the horizontal scroll position of the list as a pixel position
fn has_scrollbar(&self) -> BrowserScrollbar
Returns the type of scrollbar associated with the browser
fn set_has_scrollbar(&mut self, mode: BrowserScrollbar)
Sets the type of scrollbar associated with the browser
fn scrollbar_size(&self) -> u32
Gets the scrollbar size
fn set_scrollbar_size(&mut self, new_size: u32)
Sets the scrollbar size
fn scrollbar_width(&self) -> i32
Gets the scrollbar width
fn set_scrollbar_width(&mut self, width: i32)
Sets the scrollbar width
fn sort(&mut self)
Sorts the items of the browser
fn scrollbar(&self) -> Scrollbar
Returns the vertical scrollbar
fn hscrollbar(&self) -> Scrollbar
Returns the horizontal scrollbar