pub struct TkListbox<Inst: TkInstance>(/* private fields */);Implementations§
source§impl<Inst: TkInstance> TkListbox<Inst>
impl<Inst: TkInstance> TkListbox<Inst>
pub fn configure<Opts>( &self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn cget<Opt>(&self, _name_fn: fn(_: Obj) -> Opt) -> InterpResult<Obj>
pub fn grab(&self) -> InterpResult<()>
pub fn grab_global(&self) -> InterpResult<()>
pub fn grab_set_current(&self) -> InterpResult<()>
pub fn grab_release(&self) -> InterpResult<()>
pub fn grab_set(&self) -> InterpResult<()>
pub fn grab_set_global(&self) -> InterpResult<()>
pub fn grab_status(&self) -> InterpResult<()>
source§impl<Inst: TkInstance> TkListbox<Inst>
impl<Inst: TkInstance> TkListbox<Inst>
pub fn active(&self, index: impl Into<Index>) -> InterpResult<()>
pub fn curselection(&self) -> Result<Vec<c_int>, Enum2<DeError, InterpError>>
sourcepub fn delete(&self, index: impl Into<Index>) -> InterpResult<()>
pub fn delete(&self, index: impl Into<Index>) -> InterpResult<()>
Deletes one element of the listbox.
Examples
use tcl::*;
use tk::*;
use tk::cmd::*;
fn concat( v: Vec<Obj> ) -> String {
v.iter().map( |obj| obj.get_string() ).collect::<String>()
}
fn main() -> TkResult<()> {
let tk = make_tk!()?;
let root = tk.root();
tk.set( "items", "a b c d e f g h i" );
let lbox = root.add_listbox( "lbox" -listvariable("items") )?;
lbox.delete(1)?;
assert_eq!( concat( lbox.get_range(..)? ), "acdefghi" );
Ok(())
}sourcepub fn delete_range(&self, range: impl Into<TkRange<Index>>) -> InterpResult<()>
pub fn delete_range(&self, range: impl Into<TkRange<Index>>) -> InterpResult<()>
Deletes one or more elements of the listbox.
Examples
use tcl::*;
use tk::*;
use tk::cmd::*;
fn concat( v: Vec<Obj> ) -> String {
v.iter().map( |obj| obj.get_string() ).collect::<String>()
}
fn main() -> TkResult<()> {
let tk = make_tk!()?;
let root = tk.root();
tk.set( "items", "a b c d e f g h i" );
let lbox = root.add_listbox( "lbox" -listvariable("items") )?;
lbox.delete_range(1..=1)?;
assert_eq!( concat( lbox.get_range(..)? ), "acdefghi" );
lbox.delete_range(6..)?;
assert_eq!( concat( lbox.get_range(..)? ), "acdefg" );
lbox.delete_range(..=1)?;
assert_eq!( concat( lbox.get_range(..)? ), "defg" );
lbox.delete_range(1..=2)?;
assert_eq!( concat( lbox.get_range(..)? ), "dg" );
lbox.delete_range(..)?;
assert_eq!( concat( lbox.get_range(..)? ), "" );
Ok(())
}sourcepub fn get(
&self,
index: impl Into<Index>
) -> Result<Obj, Enum2<InterpError, NotList>>
pub fn get( &self, index: impl Into<Index> ) -> Result<Obj, Enum2<InterpError, NotList>>
Returns the contents of the listbox element indicated by the index, or an empty string if first refers to a non-existent element.
Examples
use tcl::*;
use tk::*;
use tk::cmd::*;
fn main() -> TkResult<()> {
let tk = make_tk!()?;
let root = tk.root();
tk.set( "items", "alpha beta gamma" );
let lbox = root.add_listbox( "lbox" -listvariable("items") -height(5) )?.pack(())?;
let expected = vec![ "alpha".to_owned(), "beta".to_owned(), "gamma".to_owned() ];
assert_eq!( lbox.get(0)?.get_string(), expected[0] );
assert_eq!( lbox.get(1)?.get_string(), expected[1] );
assert_eq!( lbox.get(2)?.get_string(), expected[2] );
assert_eq!( lbox.get(3)?.get_string(), "" );
assert_eq!( lbox.get( TkListboxIndex::End )?.get_string(), expected[2] );
Ok(())
}sourcepub fn get_range(
&self,
range: impl Into<TkRange<Index>>
) -> Result<Vec<Obj>, Enum2<InterpError, NotList>>
pub fn get_range( &self, range: impl Into<TkRange<Index>> ) -> Result<Vec<Obj>, Enum2<InterpError, NotList>>
Returns a list whose elements are all of the listbox elements in the range.
Examples
use tcl::*;
use tk::*;
use tk::cmd::*;
fn main() -> TkResult<()> {
let tk = make_tk!()?;
let root = tk.root();
tk.set( "items", "alpha beta gamma" );
let lbox = root.add_listbox( "lbox" -listvariable("items") -height(5) )?.pack(())?;
let expected = vec![ "alpha".to_owned(), "beta".to_owned(), "gamma".to_owned() ];
assert_eq!( &lbox.get_range( .. )?.iter().map( |obj| obj.get_string() ).collect::<Vec<_>>(), &expected );
assert_eq!( &lbox.get_range(0.. )?.iter().map( |obj| obj.get_string() ).collect::<Vec<_>>(), &expected );
assert_eq!( &lbox.get_range( ..=2)?.iter().map( |obj| obj.get_string() ).collect::<Vec<_>>(), &expected );
assert_eq!( &lbox.get_range(0..=2)?.iter().map( |obj| obj.get_string() ).collect::<Vec<_>>(), &expected );
assert_eq!( &lbox.get_range(1..=2)?.iter().map( |obj| obj.get_string() ).collect::<Vec<_>>(), &expected[1..=2] );
Ok(())
}pub fn index(&self, index: impl Into<Index>) -> InterpResult<c_longlong>
pub fn insert( &self, index: impl Into<Index>, elements: impl IntoIterator<Item = Obj> ) -> InterpResult<()>
pub fn insert_end( &self, elements: impl IntoIterator<Item = Obj> ) -> InterpResult<()>
pub fn itemcget<Opt, Val>( &self, index: impl Into<Index>, _name_fn: fn(_: Val) -> Opt ) -> InterpResult<Obj>
pub fn itemconfigure<Opts>( &self, index: impl Into<Index>, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn nearest(&self, y: c_int) -> InterpResult<c_longlong>
pub fn scan_mark(&self, x: c_int, y: c_int) -> InterpResult<()>
pub fn scan_dragto(&self, x: c_int, y: c_int) -> InterpResult<()>
pub fn see(&self, index: impl Into<Index>) -> InterpResult<()>
pub fn selection_anchor(&self, index: impl Into<Index>) -> InterpResult<()>
pub fn selection_clear(&self, index: impl Into<Index>) -> InterpResult<()>
pub fn selection_clear_range( &self, range: impl Into<TkRange<Index>> ) -> InterpResult<()>
pub fn selection_includes(&self, index: impl Into<Index>) -> InterpResult<bool>
pub fn selection_set(&self, index: impl Into<Index>) -> InterpResult<()>
pub fn selection_set_range( &self, range: impl Into<TkRange<Index>> ) -> InterpResult<()>
pub fn size(&self) -> InterpResult<c_longlong>
Methods from Deref<Target = Widget<Inst>>§
pub fn path(&self) -> &'static str
sourcepub fn add_widgets<Widgs, Shape>(
&self,
path_widgets: PathOptsWidgets<(), Widgs>
) -> InterpResult<CreatedWidgets<Inst>>where
Widgs: ConvertTuple,
<Widgs as ConvertTuple>::Output: DomForest<(&'static str, &'static str), OptPair, Shape>,
pub fn add_widgets<Widgs, Shape>(
&self,
path_widgets: PathOptsWidgets<(), Widgs>
) -> InterpResult<CreatedWidgets<Inst>>where
Widgs: ConvertTuple,
<Widgs as ConvertTuple>::Output: DomForest<(&'static str, &'static str), OptPair, Shape>,
Adds child widget(s) containing hierachical trees of children widgets, including geometry managers.
Examples
use tk::*;
use tk::cmd::*;
fn main() -> TkResult<()> {
let tk = make_tk!()?;
let root = tk.root();
root.add_widgets(
-pack(
-button( -text("hello,tk!") -command("") )
-pack( -button( -text("oops") ))
-frame( -pack(
-button( -text("exit") -command("destroy .") )
-option_menu( "optmenu1", "my_opt", &[ "ALPHA", "BETA", "GAMMA" ])
))
)
-pack( -expand(1)
-button( -text("demo") )
-button( -text("demo") )
-option_menu( "optmenu2", "your_opt", &[ "alpha", "beta", "gamma" ])
)
)?;
Ok( main_loop() )
}pub fn pack_configure<Opts>( &self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn pack_forget(&self) -> InterpResult<()>
pub fn pack_info(&self) -> InterpResult<HashMap<String, Obj>>
pub fn grid_configure<Opts>( &self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn grid_forget(&self) -> InterpResult<()>
pub fn grid_info(&self) -> InterpResult<HashMap<String, Obj>>
pub fn place_configure<Opts>( &self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn place_forget(&self) -> InterpResult<()>
pub fn place_info(&self) -> InterpResult<HashMap<String, Obj>>
pub fn grid_slaves<Opts>( &self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> Result<Vec<Widget<Inst>>, Enum3<InterpError, NotList, WidgetNotFound>>
pub fn pack_slaves( &self ) -> Result<Vec<Widget<Inst>>, Enum3<InterpError, NotList, WidgetNotFound>>
pub fn place_slaves( &self ) -> Result<Vec<Widget<Inst>>, Enum3<InterpError, NotList, WidgetNotFound>>
pub fn has_used_input_methods(&self) -> InterpResult<bool>
pub fn use_input_methods(&self, should_use: bool) -> InterpResult<()>
pub fn inactive(&self) -> InterpResult<c_longlong>
pub fn inactive_reset(&self) -> InterpResult<c_longlong>
pub fn scaling(&self) -> InterpResult<c_double>
pub fn set_scaling(&self, number: c_double) -> InterpResult<()>
pub fn lower(&self) -> InterpResult<()>
pub fn lower_below(&self, below_this: &Self) -> InterpResult<()>
pub fn raise(&self) -> InterpResult<()>
pub fn raise_above(&self, above_this: &Self) -> InterpResult<()>
pub fn bind( &self, sequence: impl Into<TkEventSeq>, script: impl Into<Obj> ) -> InterpResult<()>
pub fn bind_more( &self, sequence: impl Into<TkEventSeq>, script: impl Into<Obj> ) -> InterpResult<()>
sourcepub fn event_generate<Opts>(
&self,
event: TkEvent,
opts: impl Into<PathOptsWidgets<Opts, ()>>
) -> InterpResult<()>
pub fn event_generate<Opts>( &self, event: TkEvent, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
Generates a window event and arranges for it to be processed just as if it had
come from the window system. event provides a basic description of the event,
such as shift_button_2() or paste(). If Window is empty the whole screen is
meant, and coordinates are relative to the screen. Option-value pairs may be
used to specify additional attributes of the event, such as the x and y mouse
position; see EVENT FIELDS for more. If the -when option is not specified, the
event is processed immediately: all of the handlers for the event will complete
before the event generate command returns. If the -when option is specified
then it determines when the event is processed. Certain events, such as key
events, require that the window has focus to receive the event properly.
pub fn grid_anchor(&self, anchor: impl Into<Obj>) -> InterpResult<()>
pub fn grid_bbox( &self, grids: Grids ) -> Result<TkBBox, Enum2<DeError, InterpError>>
pub fn grid_columnconfigure<Opts>( &self, index: impl Into<Obj>, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn grid_location( &self, x: c_int, y: c_int ) -> Result<Grid, Enum2<DeError, InterpError>>
pub fn grid_propagate(&self, do_propagate: bool) -> InterpResult<()>
pub fn grid_propagated(&self) -> InterpResult<bool>
pub fn grid_rowconfigure<Opts>( &self, index: impl Into<Obj>, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn grid_remove(&self) -> InterpResult<()>
pub fn grid_size(&self) -> Result<Size, Enum2<DeError, InterpError>>
pub fn pack_propagate(&self, do_propagate: bool) -> InterpResult<()>
pub fn pack_propagated(&self) -> InterpResult<bool>
pub fn focus(&self) -> InterpResult<()>
pub fn focus_displayof(&self) -> InterpResult<Obj>
pub fn focus_force(&self) -> InterpResult<()>
pub fn focus_lastfor(&self) -> InterpResult<Obj>
pub fn winfo_atom(&self, name: &str) -> InterpResult<c_longlong>
pub fn winfo_atom_name(&self, id: c_longlong) -> InterpResult<String>
pub fn winfo_cells(&self) -> InterpResult<c_int>
pub fn winfo_children( &self ) -> Result<Vec<Widget<Inst>>, Enum3<InterpError, NotList, WidgetNotFound>>
pub fn winfo_class(&self) -> InterpResult<String>
pub fn winfo_colormap_full(&self) -> InterpResult<bool>
pub fn winfo_containing( &self, root_x: c_int, root_y: c_int ) -> InterpResult<String>
pub fn winfo_depth(&self) -> InterpResult<c_int>
pub fn winfo_fpixels(&self, number: TkDistance) -> InterpResult<c_double>
pub fn winfo_geometry( &self ) -> Result<TkGeometry, Enum2<InterpError, TkGeometryParseError>>
pub fn winfo_height(&self) -> InterpResult<c_int>
pub fn winfo_id(&self) -> InterpResult<String>
sourcepub fn winfo_interps(&self) -> Result<Vec<String>, Enum2<InterpError, NotList>>
pub fn winfo_interps(&self) -> Result<Vec<String>, Enum2<InterpError, NotList>>
Returns a list whose members are the names of all Tcl interpreters (e.g. all Tk-based applications) currently registered for the display of window.
pub fn winfo_ismapped(&self) -> InterpResult<bool>
sourcepub fn winfo_manager(&self) -> InterpResult<String>
pub fn winfo_manager(&self) -> InterpResult<String>
Returns the name of the geometry manager currently responsible for window, or an empty string if window is not managed by any geometry manager. The name is usually the name of the Tcl command for the geometry manager, such as pack or place. If the geometry manager is a widget, such as canvases or text, the name is the widget’s class command, such as canvas.
Examples
use tk::*;
use tk::cmd::*;
fn main() -> TkResult<()> {
let mut tk = make_tk!()?;
let root = tk.root();
let label = root.add_label( -text("lorum") )?.pack(())?;
Ok( assert_eq!( label.winfo_manager().unwrap().as_str(), "pack" ))
}pub fn winfo_name(&self) -> InterpResult<String>
pub fn winfo_parent(&self) -> InterpResult<Option<String>>
pub fn winfo_pathname(&self, id: c_ulong) -> InterpResult<String>
pub fn winfo_pixels(&self, number: TkDistance) -> InterpResult<c_int>
pub fn winfo_pointerx(&self) -> InterpResult<Option<c_int>>
pub fn winfo_pointerxy( &self ) -> Result<Option<TkCoord>, Enum2<DeError, InterpError>>
pub fn winfo_pointery(&self) -> InterpResult<Option<c_int>>
pub fn winfo_reqheight(&self) -> InterpResult<c_int>
pub fn winfo_reqwidth(&self) -> InterpResult<c_int>
pub fn winfo_rgb( &self, color: TkColor<'_> ) -> Result<TkRGB, Enum2<DeError, InterpError>>
pub fn winfo_rootx(&self) -> InterpResult<c_int>
pub fn winfo_rooty(&self) -> InterpResult<c_int>
pub fn winfo_screen( &self ) -> Result<TkScreenName, Enum2<InterpError, TkScreenNameParseError>>
pub fn winfo_screencells(&self) -> InterpResult<c_int>
pub fn winfo_screendepth(&self) -> InterpResult<c_int>
pub fn winfo_screenheight(&self) -> InterpResult<c_int>
pub fn winfo_screenmmheight(&self) -> InterpResult<c_int>
pub fn winfo_screenmmwidth(&self) -> InterpResult<c_int>
pub fn winfo_screenvisual( &self ) -> Result<TkVisualClass, Enum2<DeError, InterpError>>
pub fn winfo_screenwidth(&self) -> InterpResult<c_int>
pub fn winfo_server(&self) -> InterpResult<String>
pub fn winfo_toplevel(&self) -> InterpResult<TkToplevel<Inst>>
pub fn winfo_viewable(&self) -> InterpResult<bool>
pub fn winfo_visual(&self) -> Result<TkVisualClass, Enum2<DeError, InterpError>>
pub fn winfo_visualid(&self) -> InterpResult<String>
pub fn winfo_visualsavailable( &self ) -> Result<Vec<(TkVisualClass, c_int)>, Enum4<DeError, InterpError, NotList, NotSeqOf<(TkVisualClass, c_int)>>>
pub fn winfo_visualsavailable_includeids( &self ) -> Result<Vec<(TkVisualClass, c_int, String)>, Enum4<DeError, InterpError, NotList, NotSeqOf<(TkVisualClass, c_int, String)>>>
pub fn winfo_vrootheight(&self) -> InterpResult<c_int>
pub fn winfo_vrootwidth(&self) -> InterpResult<c_int>
pub fn winfo_vrootx(&self) -> InterpResult<c_int>
pub fn winfo_vrooty(&self) -> InterpResult<c_int>
pub fn winfo_width(&self) -> InterpResult<c_int>
pub fn winfo_x(&self) -> InterpResult<c_int>
pub fn winfo_y(&self) -> InterpResult<c_int>
pub fn set_wm_aspect( &self, min_numer: impl Into<Obj>, min_denom: impl Into<Obj>, max_numer: impl Into<Obj>, max_denom: impl Into<Obj> ) -> InterpResult<()>
pub fn wm_aspect( &self ) -> Result<(c_int, c_int, c_int, c_int), Enum2<DeError, InterpError>>
pub fn wm_clear_aspect(&self) -> InterpResult<()>
pub fn wm_attributes(&self) -> InterpResult<Obj>
pub fn set_wm_attributes<Opts>( &self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<()>
pub fn set_wm_client(&self, name: &str) -> InterpResult<()>
pub fn wm_client(&self) -> InterpResult<String>
pub fn set_wm_colormapwindows( &self, windows: Vec<Widget<Inst>> ) -> InterpResult<()>
pub fn wm_colormapwindows( &self ) -> Result<Vec<Widget<Inst>>, Enum3<InterpError, NotList, WidgetNotFound>>
pub fn set_wm_command(&self, command: impl Into<Obj>) -> InterpResult<()>
pub fn wm_command(&self) -> InterpResult<Obj>
pub fn wm_deiconify(&self) -> InterpResult<()>
pub fn set_wm_focusmodel(&self, focus_model: TkFocusModel) -> InterpResult<()>
pub fn wm_focusmodel(&self) -> Result<TkFocusModel, Enum2<DeError, InterpError>>
pub fn wm_forget(&self) -> InterpResult<()>
pub fn wm_frame(&self) -> InterpResult<String>
pub fn set_wm_geometry(&self, geometry: TkGeometry) -> InterpResult<()>
pub fn wm_geometry( &self ) -> Result<TkGeometry, Enum2<InterpError, TkGeometryParseError>>
pub fn set_wm_grid(&self, acceptable_size: TkAcceptableSize) -> InterpResult<()>
pub fn wm_grid( &self ) -> Result<TkAcceptableSize, Enum3<InterpError, NotList, TkAcceptableSizeParseError>>
pub fn set_wm_group(&self, leader: Widget<Inst>) -> InterpResult<()>
pub fn clear_wm_group(&self) -> InterpResult<()>
pub fn wm_group(&self) -> InterpResult<Option<Widget<Inst>>>
pub fn set_wm_iconbitmap(&self, bitmap: &str) -> InterpResult<()>
pub fn clear_wm_iconbitmap(&self) -> InterpResult<()>
pub fn wm_iconbitmap(&self) -> InterpResult<String>
pub fn wm_iconify(&self) -> InterpResult<()>
pub fn set_wm_iconmask(&self, bitmap: &str) -> InterpResult<()>
pub fn clear_wm_iconmask(&self) -> InterpResult<()>
pub fn wm_iconmask(&self) -> InterpResult<Option<String>>
pub fn set_wm_iconname(&self, name: &str) -> InterpResult<()>
pub fn wm_iconname(&self) -> InterpResult<String>
pub fn set_wm_iconphoto( &self, image: &str, extra_images: Option<&[&str]> ) -> InterpResult<()>
pub fn set_wm_iconposition(&self, x: c_int, y: c_int) -> InterpResult<()>
pub fn clear_wm_iconposition(&self) -> InterpResult<()>
pub fn wm_iconposition(&self) -> Result<TkCoord, Enum2<DeError, InterpError>>
pub fn set_wm_iconwindow(&self, icon_window: Widget<Inst>) -> InterpResult<()>
pub fn clear_wm_iconwindow(&self) -> InterpResult<()>
pub fn wm_iconwindow(&self) -> InterpResult<Option<Widget<Inst>>>
pub fn set_wm_maxsize(&self, width: c_int, height: c_int) -> InterpResult<()>
pub fn wm_maxsize(&self) -> Result<TkSize, Enum2<DeError, InterpError>>
pub fn set_wm_minsize(&self, width: c_int, height: c_int) -> InterpResult<()>
pub fn wm_minsize(&self) -> Result<TkSize, Enum2<DeError, InterpError>>
pub fn set_wm_overrideredirect( &self, overrideredirect: bool ) -> InterpResult<()>
pub fn wm_overrideredirect(&self) -> InterpResult<bool>
pub fn set_wm_positionfrom(&self, who: TkRequester) -> InterpResult<()>
pub fn clear_wm_positionfrom(&self) -> InterpResult<()>
pub fn wm_positionfrom( &self ) -> Result<Option<TkRequester>, Enum2<InterpError, TkRequesterParseError>>
pub unsafe fn set_wm_protocol( &self, name: &str, command: impl Into<Obj> ) -> InterpResult<()>
pub fn clear_wm_protocol_command(&self, name: &str) -> InterpResult<Obj>
pub unsafe fn wm_protocol_command( &self, name: &str ) -> InterpResult<Option<Obj>>
pub fn wm_protocol( &self ) -> Result<Vec<TkHandler>, Enum3<NotSeqOf<TkHandler>, NotList, InterpError>>
pub fn set_wm_resizable( &self, width_resizable: bool, height_resizable: bool ) -> InterpResult<()>
pub fn wm_resizable( &self ) -> Result<TkResizable, Enum2<InterpError, TkResizableParseError>>
pub fn set_wm_sizefrom(&self, who: TkRequester) -> InterpResult<()>
pub fn clear_wm_sizefrom(&self) -> InterpResult<()>
pub fn wm_sizefrom( &self ) -> Result<Option<TkRequester>, Enum2<InterpError, TkRequesterParseError>>
pub fn wm_stackorder( &self ) -> Result<Vec<Widget<Inst>>, Enum3<InterpError, NotList, WidgetNotFound>>
pub fn wm_stackorder_isabove(&self, widget: &Widget<Inst>) -> InterpResult<bool>
pub fn wm_stackorder_isbelow(&self, widget: &Widget<Inst>) -> InterpResult<bool>
pub fn set_wm_state(&self, new_state: TkState) -> InterpResult<()>
pub fn wm_state(&self) -> Result<TkState, Enum2<DeError, InterpError>>
pub fn set_wm_title(&self, title: impl Into<Obj>) -> InterpResult<()>
pub fn wm_title(&self) -> InterpResult<String>
pub fn set_wm_transient(&self, master: &TkToplevel<Inst>) -> InterpResult<()>
pub fn clear_wm_transient(&self) -> InterpResult<()>
pub fn wm_transient(&self) -> InterpResult<Option<TkToplevel<Inst>>>
pub fn wm_withdraw(&self) -> InterpResult<()>
sourcepub fn font_actual<'a, Opt, Opts>(
&self,
font: Font<'a, Opts>,
_option: Opt,
ch: Option<char>
) -> InterpResult<Obj>
pub fn font_actual<'a, Opt, Opts>( &self, font: Font<'a, Opts>, _option: Opt, ch: Option<char> ) -> InterpResult<Obj>
Returns the value of the actual attributes that are obtained when font is used on window’s display; the actual attribute obtained may differ from the attribute requested due to platform-dependent limitations, such as the availability of font families and point sizes. If the char argument is supplied, the font attributes returned will be those of the specific font used to render that character, which will be different from the base font if the base font does not contain the given character.
sourcepub fn font_actual_get_all<'a, Opts>(
&self,
font: Font<'a, Opts>
) -> InterpResult<Obj>
pub fn font_actual_get_all<'a, Opts>( &self, font: Font<'a, Opts> ) -> InterpResult<Obj>
Returns a list of all the atual attributes and their values that are obtained when font is used on window’s display; the actual attributes obtained may differ from the attributes requested due to platform-dependent limitations, such as the availability of font families and point sizes. If the char argument is supplied, the font attributes returned will be those of the specific font used to render that character, which will be different from the base font if the base font does not contain the given character.
pub fn font_families(&self) -> Result<Vec<String>, Enum2<InterpError, NotList>>
pub fn font_measure<'a, Opts>( &self, font: Font<'a, Opts>, text: impl Into<String> ) -> InterpResult<c_longlong>
pub fn font_metrics<'a, Opt, Opts>( &self, font: Font<'a, Opts>, _opt: Opt ) -> InterpResult<Obj>
pub fn font_metrics_get_all<'a, Opts>( &self, font: Font<'a, Opts> ) -> Result<Vec<OptPair>, Enum3<InterpError, NotList, NotSeqOf<OptPair>>>
Trait Implementations§
source§impl<Inst: TkInstance> TkBBoxTrait<Inst> for TkListbox<Inst>
impl<Inst: TkInstance> TkBBoxTrait<Inst> for TkListbox<Inst>
source§impl<Inst: TkInstance> TkGridSlave for TkListbox<Inst>
impl<Inst: TkInstance> TkGridSlave for TkListbox<Inst>
fn grid<Opts, Inst: TkInstance>( self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<Self>
source§impl<Inst: TkInstance> TkPackSlave for TkListbox<Inst>
impl<Inst: TkInstance> TkPackSlave for TkListbox<Inst>
fn pack<Opts, Inst: TkInstance>( self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<Self>
source§impl<Inst: TkInstance> TkPlaceSlave for TkListbox<Inst>
impl<Inst: TkInstance> TkPlaceSlave for TkListbox<Inst>
fn place<Opts, Inst: TkInstance>( self, opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<Self>
source§impl<TK: TkInstance> TkXView<TK> for TkListbox<TK>
impl<TK: TkInstance> TkXView<TK> for TkListbox<TK>
fn xview(&self) -> Result<(c_double, c_double), Enum2<DeError, InterpError>>
fn xview_moveto(&self, fraction: c_double) -> InterpResult<()>
fn xview_scroll_units(&self, number: c_double) -> InterpResult<()>
fn xview_scroll_pages(&self, number: c_double) -> InterpResult<()>
fn xview_(&self, args: Vec<Obj>) -> InterpResult<()>
source§impl<TK: TkInstance> TkXViewIndex<TK> for TkListbox<TK>
impl<TK: TkInstance> TkXViewIndex<TK> for TkListbox<TK>
type Index = Index
fn xview_index(&self, index: Self::Index) -> InterpResult<()>
source§impl<TK: TkInstance> TkYView<TK> for TkListbox<TK>
impl<TK: TkInstance> TkYView<TK> for TkListbox<TK>
fn yview(&self) -> Result<(c_double, c_double), Enum2<DeError, InterpError>>
fn yview_moveto(&self, fraction: c_double) -> InterpResult<()>
fn yview_scroll_units(&self, number: c_double) -> InterpResult<()>
fn yview_scroll_pages(&self, number: c_double) -> InterpResult<()>
fn yview_(&self, args: Vec<Obj>) -> InterpResult<()>
source§impl<TK: TkInstance> TkYViewIndex<TK> for TkListbox<TK>
impl<TK: TkInstance> TkYViewIndex<TK> for TkListbox<TK>
type Index = Index
fn yview_index(&self, index: Self::Index) -> InterpResult<()>
source§impl<Inst: TkInstance> UpcastFrom<Inst> for TkListbox<Inst>
impl<Inst: TkInstance> UpcastFrom<Inst> for TkListbox<Inst>
fn upcast_from(upcastable_widget: UpcastableWidget<Inst>) -> Option<Self>
impl<Inst: Copy + TkInstance> Copy for TkListbox<Inst>
Auto Trait Implementations§
impl<Inst> RefUnwindSafe for TkListbox<Inst>where
Inst: RefUnwindSafe,
impl<Inst> !Send for TkListbox<Inst>
impl<Inst> !Sync for TkListbox<Inst>
impl<Inst> Unpin for TkListbox<Inst>where
Inst: Unpin,
impl<Inst> UnwindSafe for TkListbox<Inst>where
Inst: UnwindSafe,
Blanket Implementations§
source§impl<Widg, Inst> AddHBox for Widg
impl<Widg, Inst> AddHBox for Widg
fn add_hbox<Opts, Inst: TkInstance>(
&self,
initial_ratio: f64,
hbox_resize: HBoxResize,
path_opts: impl Into<PathOptsWidgets<Opts, ()>>
) -> InterpResult<HBox<Inst>>where
Self: Sized + Deref<Target = Widget<Inst>>,
Opts: IntoHomoTuple<TtkFrameOpt> + IntoHomoTuple<OptPair>,
source§impl<Widg, Inst> AddTkButton for Widg
impl<Widg, Inst> AddTkButton for Widg
source§impl<Widg, Inst> AddTkCanvas for Widg
impl<Widg, Inst> AddTkCanvas for Widg
fn add_canvas<Opts, Inst: TkInstance>(
&self,
path_opts: impl Into<PathOptsWidgets<Opts, ()>>
) -> InterpResult<TkCanvas<Inst>>where
Self: Deref<Target = Widget<Inst>>,
Opts: IntoHomoTuple<TkCanvasOpt> + IntoHomoTuple<OptPair>,
source§impl<Widg, Inst> AddTkEntry for Widg
impl<Widg, Inst> AddTkEntry for Widg
fn add_entry<Opts, Inst: TkInstance>( &self, path_opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<TkEntry<Inst>>
source§impl<Widg, Inst> AddTkFrame for Widg
impl<Widg, Inst> AddTkFrame for Widg
fn add_frame<Opts, Inst: TkInstance>( &self, path_opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<TkFrame<Inst>>
source§impl<Widg, Inst> AddTkLabel for Widg
impl<Widg, Inst> AddTkLabel for Widg
fn add_label<Opts, Inst: TkInstance>( &self, path_opts: impl Into<PathOptsWidgets<Opts, ()>> ) -> InterpResult<TkLabel<Inst>>
source§impl<Widg, Inst> AddTkLabelframe for Widg
impl<Widg, Inst> AddTkLabelframe for Widg
fn add_labelframe<Opts, Inst: TkInstance>(
&self,
path_opts: impl Into<PathOptsWidgets<Opts, ()>>
) -> InterpResult<TkLabelframe<Inst>>where
Self: Deref<Target = Widget<Inst>>,
Opts: IntoHomoTuple<TkLabelframeOpt> + IntoHomoTuple<OptPair>,
source§impl<Widg, Inst> AddTkListbox for Widg
impl<Widg, Inst> AddTkListbox for Widg
fn add_listbox<Opts, Inst: TkInstance>(
&self,
path_opts: impl Into<PathOptsWidgets<Opts, ()>>
) -> InterpResult<TkListbox<Inst>>where
Self: Deref<Target = Widget<Inst>>,
Opts: IntoHomoTuple<TkListboxOpt> + IntoHomoTuple<OptPair>,
source§impl<Widg, Inst> AddTkMessage for Widg
impl<Widg, Inst> AddTkMessage for Widg
fn add_message<Opts, Inst: TkInstance>(
&self,
path_opts: impl Into<PathOptsWidgets<Opts, ()>>
) -> InterpResult<TkMessage<Inst>>where
Self: Deref<Target = Widget<Inst>>,
Opts: IntoHomoTuple<TkMessageOpt> + IntoHomoTuple<OptPair>,
source§impl<Widg, Inst> AddTkOptionMenu for Widg
impl<Widg, Inst> AddTkOptionMenu for Widg
path_seg, plus an associated menu.
Together they allow the user to select one of the items given by the item
arguments. The current item will be stored in the global variable whose name is
given by var_name and it will also be displayed as the label in the option
menubutton. The user can click on the menubutton to display a menu containing
all of the values and thereby select a new item. Once a new item is selected, it
will be stored in the variable and appear in the option menubutton. The current
value can also be changed by setting the variable. Read more