pub trait ActionRowExt: IsA<ActionRow> + 'static {
Show 23 methods
// Provided methods
fn activate(&self) { ... }
fn add_prefix(&self, widget: &impl IsA<Widget>) { ... }
fn add_suffix(&self, widget: &impl IsA<Widget>) { ... }
fn activatable_widget(&self) -> Option<Widget> { ... }
fn icon_name(&self) -> Option<GString> { ... }
fn subtitle(&self) -> Option<GString> { ... }
fn subtitle_lines(&self) -> i32 { ... }
fn is_subtitle_selectable(&self) -> bool { ... }
fn title_lines(&self) -> i32 { ... }
fn remove(&self, widget: &impl IsA<Widget>) { ... }
fn set_activatable_widget(&self, widget: Option<&impl IsA<Widget>>) { ... }
fn set_icon_name(&self, icon_name: Option<&str>) { ... }
fn set_subtitle(&self, subtitle: &str) { ... }
fn set_subtitle_lines(&self, subtitle_lines: i32) { ... }
fn set_subtitle_selectable(&self, subtitle_selectable: bool) { ... }
fn set_title_lines(&self, title_lines: i32) { ... }
fn connect_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { ... }
fn connect_activatable_widget_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_icon_name_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_subtitle_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_subtitle_lines_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_subtitle_selectable_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_title_lines_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Provided Methodsยง
fn activate(&self)
fn add_prefix(&self, widget: &impl IsA<Widget>)
fn add_suffix(&self, widget: &impl IsA<Widget>)
fn activatable_widget(&self) -> Option<Widget>
fn icon_name(&self) -> Option<GString>
๐Deprecated: Since 1.3
fn subtitle(&self) -> Option<GString>
fn subtitle_lines(&self) -> i32
fn is_subtitle_selectable(&self) -> bool
Available on crate feature
v1_3 only.fn title_lines(&self) -> i32
fn remove(&self, widget: &impl IsA<Widget>)
fn set_activatable_widget(&self, widget: Option<&impl IsA<Widget>>)
fn set_icon_name(&self, icon_name: Option<&str>)
๐Deprecated: Since 1.3
fn set_subtitle(&self, subtitle: &str)
fn set_subtitle_lines(&self, subtitle_lines: i32)
fn set_subtitle_selectable(&self, subtitle_selectable: bool)
Available on crate feature
v1_3 only.fn set_title_lines(&self, title_lines: i32)
Sourcefn connect_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_activated<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Examples found in repository?
examples/hello-world.rs (lines 23-25)
7fn main() {
8 let application = Application::builder()
9 .application_id("com.example.FirstAdwaitaApp")
10 .build();
11
12 application.connect_startup(|_| {
13 adw::init().unwrap();
14 });
15
16 application.connect_activate(|app| {
17 // ActionRows are only available in Adwaita
18 let row = ActionRow::builder()
19 .activatable(true)
20 .selectable(false)
21 .title("Click me")
22 .build();
23 row.connect_activated(|_| {
24 eprintln!("Clicked!");
25 });
26
27 let list = ListBox::builder()
28 .margin_top(32)
29 .margin_end(32)
30 .margin_bottom(32)
31 .margin_start(32)
32 // the content class makes the list look nicer
33 .css_classes(vec![String::from("content")])
34 .build();
35 list.append(&row);
36
37 // Combine the content in a box
38 let content = Box::new(Orientation::Vertical, 0);
39 // Adwaitas' ApplicationWindow does not include a HeaderBar
40 content.append(
41 &HeaderBar::builder()
42 .title_widget(&adw::WindowTitle::new("First App", ""))
43 .build(),
44 );
45 content.append(&list);
46
47 let window = ApplicationWindow::builder()
48 .application(app)
49 .default_width(350)
50 // add content to window
51 .content(&content)
52 .build();
53 window.show();
54 });
55
56 application.run();
57}fn connect_activatable_widget_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_icon_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
๐Deprecated: Since 1.3
fn connect_subtitle_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_subtitle_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_subtitle_selectable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
Available on crate feature
v1_3 only.fn connect_title_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
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.