Struct AccessibilityContext

Source
pub struct AccessibilityContext { /* private fields */ }

Implementations§

Source§

impl AccessibilityContext

Source

pub fn new(root: Window, widgets: Vec<Box<dyn Accessible>>) -> Self

Examples found in repository?
examples/custom_widget.rs (line 55)
42fn main() {
43    let a = app::App::default();
44    let mut w = window::Window::default()
45        .with_size(400, 300)
46        .with_label("Hello Window");
47    let col = group::Flex::default_fill().column();
48    let mut b1 = MyButton::new("Click 1");
49    let mut b2 = MyButton::new("Click 2");
50    b2.set_callback(|_| println!("clicked 2"));
51    col.end();
52    w.end();
53    w.show();
54
55    let ac = AccessibilityContext::new(w, vec![Box::new(b1.clone()), Box::new(b2)]);
56
57    b1.set_callback(|_| println!("clicked 1"));
58
59    a.run_with_accessibility(ac).unwrap();
60}
More examples
Hide additional examples
examples/example2.rs (line 20)
6fn main() {
7    let a = app::App::default();
8    let mut w = window::Window::default()
9        .with_size(400, 300)
10        .with_label("Hello Window");
11    let col = group::Flex::default_fill().column();
12    let b1 = button::Button::default().with_label("Increment");
13    let f = frame::Frame::default().with_label("0");
14    let b2 = button::Button::default().with_label("Decrement");
15    col.end();
16    w.end();
17    w.make_resizable(true);
18    w.show();
19
20    let ac = AccessibilityContext::new(w, vec![Box::new(b1), Box::new(f), Box::new(b2)]);
21
22    a.run_with_accessibility(ac).unwrap();
23}
examples/form.rs (line 27)
6fn main() {
7    let a = app::App::default().with_scheme(app::Scheme::Oxy);
8    let mut w = window::Window::default()
9        .with_size(400, 300)
10        .with_label("Hello fltk-accesskit");
11    let col = group::Flex::default()
12        .with_size(200, 100)
13        .center_of_parent()
14        .column();
15    let inp = input::Input::default()
16        .with_id("inp")
17        .with_label("Enter name:");
18    let mut btn = button::Button::default().with_label("Greet");
19    let out = output::Output::default().with_id("out");
20    col.end();
21    w.end();
22    w.make_resizable(true);
23    w.show();
24
25    btn.set_callback(btn_callback);
26
27    let ac = AccessibilityContext::new(w, vec![Box::new(inp), Box::new(btn), Box::new(out)]);
28
29    a.run_with_accessibility(ac).unwrap();
30}

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more