1#![allow(deprecated)]
5
6#[cfg(feature = "v4_20")]
7#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
8use crate::WindowGravity;
9use crate::{
10 ffi, Accessible, AccessibleRole, Align, Application, AssistantPage, AssistantPageType,
11 Buildable, ConstraintTarget, LayoutManager, Native, Overflow, Root, ShortcutManager, Widget,
12 Window,
13};
14use glib::{
15 object::ObjectType as _,
16 prelude::*,
17 signal::{connect_raw, SignalHandlerId},
18 translate::*,
19};
20use std::boxed::Box as Box_;
21
22glib::wrapper! {
23 #[doc(alias = "GtkAssistant")]
24 pub struct Assistant(Object<ffi::GtkAssistant>) @extends Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager;
25
26 match fn {
27 type_ => || ffi::gtk_assistant_get_type(),
28 }
29}
30
31impl Assistant {
32 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
33 #[allow(deprecated)]
34 #[doc(alias = "gtk_assistant_new")]
35 pub fn new() -> Assistant {
36 assert_initialized_main_thread!();
37 unsafe { Widget::from_glib_none(ffi::gtk_assistant_new()).unsafe_cast() }
38 }
39
40 pub fn builder() -> AssistantBuilder {
45 AssistantBuilder::new()
46 }
47
48 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
49 #[allow(deprecated)]
50 #[doc(alias = "gtk_assistant_add_action_widget")]
51 pub fn add_action_widget(&self, child: &impl IsA<Widget>) {
52 unsafe {
53 ffi::gtk_assistant_add_action_widget(
54 self.to_glib_none().0,
55 child.as_ref().to_glib_none().0,
56 );
57 }
58 }
59
60 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
61 #[allow(deprecated)]
62 #[doc(alias = "gtk_assistant_append_page")]
63 pub fn append_page(&self, page: &impl IsA<Widget>) -> i32 {
64 unsafe {
65 ffi::gtk_assistant_append_page(self.to_glib_none().0, page.as_ref().to_glib_none().0)
66 }
67 }
68
69 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
70 #[allow(deprecated)]
71 #[doc(alias = "gtk_assistant_commit")]
72 pub fn commit(&self) {
73 unsafe {
74 ffi::gtk_assistant_commit(self.to_glib_none().0);
75 }
76 }
77
78 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
79 #[allow(deprecated)]
80 #[doc(alias = "gtk_assistant_get_current_page")]
81 #[doc(alias = "get_current_page")]
82 pub fn current_page(&self) -> i32 {
83 unsafe { ffi::gtk_assistant_get_current_page(self.to_glib_none().0) }
84 }
85
86 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
87 #[allow(deprecated)]
88 #[doc(alias = "gtk_assistant_get_n_pages")]
89 #[doc(alias = "get_n_pages")]
90 pub fn n_pages(&self) -> i32 {
91 unsafe { ffi::gtk_assistant_get_n_pages(self.to_glib_none().0) }
92 }
93
94 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
95 #[allow(deprecated)]
96 #[doc(alias = "gtk_assistant_get_nth_page")]
97 #[doc(alias = "get_nth_page")]
98 pub fn nth_page(&self, page_num: i32) -> Option<Widget> {
99 unsafe {
100 from_glib_none(ffi::gtk_assistant_get_nth_page(
101 self.to_glib_none().0,
102 page_num,
103 ))
104 }
105 }
106
107 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
108 #[allow(deprecated)]
109 #[doc(alias = "gtk_assistant_get_page")]
110 #[doc(alias = "get_page")]
111 pub fn page(&self, child: &impl IsA<Widget>) -> AssistantPage {
112 unsafe {
113 from_glib_none(ffi::gtk_assistant_get_page(
114 self.to_glib_none().0,
115 child.as_ref().to_glib_none().0,
116 ))
117 }
118 }
119
120 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
121 #[allow(deprecated)]
122 #[doc(alias = "gtk_assistant_get_page_complete")]
123 #[doc(alias = "get_page_complete")]
124 pub fn page_is_complete(&self, page: &impl IsA<Widget>) -> bool {
125 unsafe {
126 from_glib(ffi::gtk_assistant_get_page_complete(
127 self.to_glib_none().0,
128 page.as_ref().to_glib_none().0,
129 ))
130 }
131 }
132
133 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
134 #[allow(deprecated)]
135 #[doc(alias = "gtk_assistant_get_page_title")]
136 #[doc(alias = "get_page_title")]
137 pub fn page_title(&self, page: &impl IsA<Widget>) -> glib::GString {
138 unsafe {
139 from_glib_none(ffi::gtk_assistant_get_page_title(
140 self.to_glib_none().0,
141 page.as_ref().to_glib_none().0,
142 ))
143 }
144 }
145
146 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
147 #[allow(deprecated)]
148 #[doc(alias = "gtk_assistant_get_page_type")]
149 #[doc(alias = "get_page_type")]
150 pub fn page_type(&self, page: &impl IsA<Widget>) -> AssistantPageType {
151 unsafe {
152 from_glib(ffi::gtk_assistant_get_page_type(
153 self.to_glib_none().0,
154 page.as_ref().to_glib_none().0,
155 ))
156 }
157 }
158
159 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
160 #[allow(deprecated)]
161 #[doc(alias = "gtk_assistant_get_pages")]
162 #[doc(alias = "get_pages")]
163 pub fn pages(&self) -> gio::ListModel {
164 unsafe { from_glib_full(ffi::gtk_assistant_get_pages(self.to_glib_none().0)) }
165 }
166
167 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
168 #[allow(deprecated)]
169 #[doc(alias = "gtk_assistant_insert_page")]
170 pub fn insert_page(&self, page: &impl IsA<Widget>, position: i32) -> i32 {
171 unsafe {
172 ffi::gtk_assistant_insert_page(
173 self.to_glib_none().0,
174 page.as_ref().to_glib_none().0,
175 position,
176 )
177 }
178 }
179
180 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
181 #[allow(deprecated)]
182 #[doc(alias = "gtk_assistant_next_page")]
183 pub fn next_page(&self) {
184 unsafe {
185 ffi::gtk_assistant_next_page(self.to_glib_none().0);
186 }
187 }
188
189 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
190 #[allow(deprecated)]
191 #[doc(alias = "gtk_assistant_prepend_page")]
192 pub fn prepend_page(&self, page: &impl IsA<Widget>) -> i32 {
193 unsafe {
194 ffi::gtk_assistant_prepend_page(self.to_glib_none().0, page.as_ref().to_glib_none().0)
195 }
196 }
197
198 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
199 #[allow(deprecated)]
200 #[doc(alias = "gtk_assistant_previous_page")]
201 pub fn previous_page(&self) {
202 unsafe {
203 ffi::gtk_assistant_previous_page(self.to_glib_none().0);
204 }
205 }
206
207 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
208 #[allow(deprecated)]
209 #[doc(alias = "gtk_assistant_remove_action_widget")]
210 pub fn remove_action_widget(&self, child: &impl IsA<Widget>) {
211 unsafe {
212 ffi::gtk_assistant_remove_action_widget(
213 self.to_glib_none().0,
214 child.as_ref().to_glib_none().0,
215 );
216 }
217 }
218
219 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
220 #[allow(deprecated)]
221 #[doc(alias = "gtk_assistant_remove_page")]
222 pub fn remove_page(&self, page_num: i32) {
223 unsafe {
224 ffi::gtk_assistant_remove_page(self.to_glib_none().0, page_num);
225 }
226 }
227
228 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
229 #[allow(deprecated)]
230 #[doc(alias = "gtk_assistant_set_current_page")]
231 pub fn set_current_page(&self, page_num: i32) {
232 unsafe {
233 ffi::gtk_assistant_set_current_page(self.to_glib_none().0, page_num);
234 }
235 }
236
237 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
238 #[allow(deprecated)]
239 #[doc(alias = "gtk_assistant_set_forward_page_func")]
240 pub fn set_forward_page_func<P: Fn(i32) -> i32 + 'static>(&self, page_func: P) {
241 let page_func_data: Box_<P> = Box_::new(page_func);
242 unsafe extern "C" fn page_func_func<P: Fn(i32) -> i32 + 'static>(
243 current_page: std::ffi::c_int,
244 data: glib::ffi::gpointer,
245 ) -> std::ffi::c_int {
246 let callback = &*(data as *mut P);
247 (*callback)(current_page)
248 }
249 let page_func = Some(page_func_func::<P> as _);
250 unsafe extern "C" fn destroy_func<P: Fn(i32) -> i32 + 'static>(data: glib::ffi::gpointer) {
251 let _callback = Box_::from_raw(data as *mut P);
252 }
253 let destroy_call3 = Some(destroy_func::<P> as _);
254 let super_callback0: Box_<P> = page_func_data;
255 unsafe {
256 ffi::gtk_assistant_set_forward_page_func(
257 self.to_glib_none().0,
258 page_func,
259 Box_::into_raw(super_callback0) as *mut _,
260 destroy_call3,
261 );
262 }
263 }
264
265 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
266 #[allow(deprecated)]
267 #[doc(alias = "gtk_assistant_set_page_complete")]
268 pub fn set_page_complete(&self, page: &impl IsA<Widget>, complete: bool) {
269 unsafe {
270 ffi::gtk_assistant_set_page_complete(
271 self.to_glib_none().0,
272 page.as_ref().to_glib_none().0,
273 complete.into_glib(),
274 );
275 }
276 }
277
278 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
279 #[allow(deprecated)]
280 #[doc(alias = "gtk_assistant_set_page_title")]
281 pub fn set_page_title(&self, page: &impl IsA<Widget>, title: &str) {
282 unsafe {
283 ffi::gtk_assistant_set_page_title(
284 self.to_glib_none().0,
285 page.as_ref().to_glib_none().0,
286 title.to_glib_none().0,
287 );
288 }
289 }
290
291 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
292 #[allow(deprecated)]
293 #[doc(alias = "gtk_assistant_set_page_type")]
294 pub fn set_page_type(&self, page: &impl IsA<Widget>, type_: AssistantPageType) {
295 unsafe {
296 ffi::gtk_assistant_set_page_type(
297 self.to_glib_none().0,
298 page.as_ref().to_glib_none().0,
299 type_.into_glib(),
300 );
301 }
302 }
303
304 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
305 #[allow(deprecated)]
306 #[doc(alias = "gtk_assistant_update_buttons_state")]
307 pub fn update_buttons_state(&self) {
308 unsafe {
309 ffi::gtk_assistant_update_buttons_state(self.to_glib_none().0);
310 }
311 }
312
313 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
314 #[doc(alias = "use-header-bar")]
315 pub fn use_header_bar(&self) -> i32 {
316 ObjectExt::property(self, "use-header-bar")
317 }
318
319 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
320 #[doc(alias = "apply")]
321 pub fn connect_apply<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
322 unsafe extern "C" fn apply_trampoline<F: Fn(&Assistant) + 'static>(
323 this: *mut ffi::GtkAssistant,
324 f: glib::ffi::gpointer,
325 ) {
326 let f: &F = &*(f as *const F);
327 f(&from_glib_borrow(this))
328 }
329 unsafe {
330 let f: Box_<F> = Box_::new(f);
331 connect_raw(
332 self.as_ptr() as *mut _,
333 c"apply".as_ptr() as *const _,
334 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
335 apply_trampoline::<F> as *const (),
336 )),
337 Box_::into_raw(f),
338 )
339 }
340 }
341
342 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
343 #[doc(alias = "cancel")]
344 pub fn connect_cancel<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
345 unsafe extern "C" fn cancel_trampoline<F: Fn(&Assistant) + 'static>(
346 this: *mut ffi::GtkAssistant,
347 f: glib::ffi::gpointer,
348 ) {
349 let f: &F = &*(f as *const F);
350 f(&from_glib_borrow(this))
351 }
352 unsafe {
353 let f: Box_<F> = Box_::new(f);
354 connect_raw(
355 self.as_ptr() as *mut _,
356 c"cancel".as_ptr() as *const _,
357 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
358 cancel_trampoline::<F> as *const (),
359 )),
360 Box_::into_raw(f),
361 )
362 }
363 }
364
365 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
366 #[doc(alias = "close")]
367 pub fn connect_close<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
368 unsafe extern "C" fn close_trampoline<F: Fn(&Assistant) + 'static>(
369 this: *mut ffi::GtkAssistant,
370 f: glib::ffi::gpointer,
371 ) {
372 let f: &F = &*(f as *const F);
373 f(&from_glib_borrow(this))
374 }
375 unsafe {
376 let f: Box_<F> = Box_::new(f);
377 connect_raw(
378 self.as_ptr() as *mut _,
379 c"close".as_ptr() as *const _,
380 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
381 close_trampoline::<F> as *const (),
382 )),
383 Box_::into_raw(f),
384 )
385 }
386 }
387
388 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
389 #[doc(alias = "escape")]
390 pub fn connect_escape<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
391 unsafe extern "C" fn escape_trampoline<F: Fn(&Assistant) + 'static>(
392 this: *mut ffi::GtkAssistant,
393 f: glib::ffi::gpointer,
394 ) {
395 let f: &F = &*(f as *const F);
396 f(&from_glib_borrow(this))
397 }
398 unsafe {
399 let f: Box_<F> = Box_::new(f);
400 connect_raw(
401 self.as_ptr() as *mut _,
402 c"escape".as_ptr() as *const _,
403 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
404 escape_trampoline::<F> as *const (),
405 )),
406 Box_::into_raw(f),
407 )
408 }
409 }
410
411 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
412 pub fn emit_escape(&self) {
413 self.emit_by_name::<()>("escape", &[]);
414 }
415
416 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
417 #[doc(alias = "prepare")]
418 pub fn connect_prepare<F: Fn(&Self, &Widget) + 'static>(&self, f: F) -> SignalHandlerId {
419 unsafe extern "C" fn prepare_trampoline<F: Fn(&Assistant, &Widget) + 'static>(
420 this: *mut ffi::GtkAssistant,
421 page: *mut ffi::GtkWidget,
422 f: glib::ffi::gpointer,
423 ) {
424 let f: &F = &*(f as *const F);
425 f(&from_glib_borrow(this), &from_glib_borrow(page))
426 }
427 unsafe {
428 let f: Box_<F> = Box_::new(f);
429 connect_raw(
430 self.as_ptr() as *mut _,
431 c"prepare".as_ptr() as *const _,
432 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
433 prepare_trampoline::<F> as *const (),
434 )),
435 Box_::into_raw(f),
436 )
437 }
438 }
439
440 #[doc(alias = "pages")]
441 pub fn connect_pages_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
442 unsafe extern "C" fn notify_pages_trampoline<F: Fn(&Assistant) + 'static>(
443 this: *mut ffi::GtkAssistant,
444 _param_spec: glib::ffi::gpointer,
445 f: glib::ffi::gpointer,
446 ) {
447 let f: &F = &*(f as *const F);
448 f(&from_glib_borrow(this))
449 }
450 unsafe {
451 let f: Box_<F> = Box_::new(f);
452 connect_raw(
453 self.as_ptr() as *mut _,
454 c"notify::pages".as_ptr() as *const _,
455 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
456 notify_pages_trampoline::<F> as *const (),
457 )),
458 Box_::into_raw(f),
459 )
460 }
461 }
462}
463
464impl Default for Assistant {
465 fn default() -> Self {
466 Self::new()
467 }
468}
469
470#[must_use = "The builder must be built to be used"]
475pub struct AssistantBuilder {
476 builder: glib::object::ObjectBuilder<'static, Assistant>,
477}
478
479impl AssistantBuilder {
480 fn new() -> Self {
481 Self {
482 builder: glib::object::Object::builder(),
483 }
484 }
485
486 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
487 pub fn use_header_bar(self, use_header_bar: i32) -> Self {
488 Self {
489 builder: self.builder.property("use-header-bar", use_header_bar),
490 }
491 }
492
493 pub fn application(self, application: &impl IsA<Application>) -> Self {
494 Self {
495 builder: self
496 .builder
497 .property("application", application.clone().upcast()),
498 }
499 }
500
501 pub fn child(self, child: &impl IsA<Widget>) -> Self {
502 Self {
503 builder: self.builder.property("child", child.clone().upcast()),
504 }
505 }
506
507 pub fn decorated(self, decorated: bool) -> Self {
508 Self {
509 builder: self.builder.property("decorated", decorated),
510 }
511 }
512
513 pub fn default_height(self, default_height: i32) -> Self {
514 Self {
515 builder: self.builder.property("default-height", default_height),
516 }
517 }
518
519 pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
520 Self {
521 builder: self
522 .builder
523 .property("default-widget", default_widget.clone().upcast()),
524 }
525 }
526
527 pub fn default_width(self, default_width: i32) -> Self {
528 Self {
529 builder: self.builder.property("default-width", default_width),
530 }
531 }
532
533 pub fn deletable(self, deletable: bool) -> Self {
534 Self {
535 builder: self.builder.property("deletable", deletable),
536 }
537 }
538
539 pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
540 Self {
541 builder: self
542 .builder
543 .property("destroy-with-parent", destroy_with_parent),
544 }
545 }
546
547 pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
548 Self {
549 builder: self.builder.property("display", display.clone().upcast()),
550 }
551 }
552
553 pub fn focus_visible(self, focus_visible: bool) -> Self {
554 Self {
555 builder: self.builder.property("focus-visible", focus_visible),
556 }
557 }
558
559 pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
560 Self {
561 builder: self
562 .builder
563 .property("focus-widget", focus_widget.clone().upcast()),
564 }
565 }
566
567 pub fn fullscreened(self, fullscreened: bool) -> Self {
568 Self {
569 builder: self.builder.property("fullscreened", fullscreened),
570 }
571 }
572
573 #[cfg(feature = "v4_20")]
574 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
575 pub fn gravity(self, gravity: WindowGravity) -> Self {
576 Self {
577 builder: self.builder.property("gravity", gravity),
578 }
579 }
580
581 #[cfg(feature = "v4_2")]
582 #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
583 pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
584 Self {
585 builder: self
586 .builder
587 .property("handle-menubar-accel", handle_menubar_accel),
588 }
589 }
590
591 pub fn hide_on_close(self, hide_on_close: bool) -> Self {
592 Self {
593 builder: self.builder.property("hide-on-close", hide_on_close),
594 }
595 }
596
597 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
598 Self {
599 builder: self.builder.property("icon-name", icon_name.into()),
600 }
601 }
602
603 pub fn maximized(self, maximized: bool) -> Self {
604 Self {
605 builder: self.builder.property("maximized", maximized),
606 }
607 }
608
609 pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
610 Self {
611 builder: self
612 .builder
613 .property("mnemonics-visible", mnemonics_visible),
614 }
615 }
616
617 pub fn modal(self, modal: bool) -> Self {
618 Self {
619 builder: self.builder.property("modal", modal),
620 }
621 }
622
623 pub fn resizable(self, resizable: bool) -> Self {
624 Self {
625 builder: self.builder.property("resizable", resizable),
626 }
627 }
628
629 pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
630 Self {
631 builder: self.builder.property("startup-id", startup_id.into()),
632 }
633 }
634
635 pub fn title(self, title: impl Into<glib::GString>) -> Self {
636 Self {
637 builder: self.builder.property("title", title.into()),
638 }
639 }
640
641 #[cfg(feature = "v4_6")]
642 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
643 pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
644 Self {
645 builder: self.builder.property("titlebar", titlebar.clone().upcast()),
646 }
647 }
648
649 pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
650 Self {
651 builder: self
652 .builder
653 .property("transient-for", transient_for.clone().upcast()),
654 }
655 }
656
657 pub fn can_focus(self, can_focus: bool) -> Self {
658 Self {
659 builder: self.builder.property("can-focus", can_focus),
660 }
661 }
662
663 pub fn can_target(self, can_target: bool) -> Self {
664 Self {
665 builder: self.builder.property("can-target", can_target),
666 }
667 }
668
669 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
670 Self {
671 builder: self.builder.property("css-classes", css_classes.into()),
672 }
673 }
674
675 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
676 Self {
677 builder: self.builder.property("css-name", css_name.into()),
678 }
679 }
680
681 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
682 Self {
683 builder: self.builder.property("cursor", cursor.clone()),
684 }
685 }
686
687 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
688 Self {
689 builder: self.builder.property("focus-on-click", focus_on_click),
690 }
691 }
692
693 pub fn focusable(self, focusable: bool) -> Self {
694 Self {
695 builder: self.builder.property("focusable", focusable),
696 }
697 }
698
699 pub fn halign(self, halign: Align) -> Self {
700 Self {
701 builder: self.builder.property("halign", halign),
702 }
703 }
704
705 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
706 Self {
707 builder: self.builder.property("has-tooltip", has_tooltip),
708 }
709 }
710
711 pub fn height_request(self, height_request: i32) -> Self {
712 Self {
713 builder: self.builder.property("height-request", height_request),
714 }
715 }
716
717 pub fn hexpand(self, hexpand: bool) -> Self {
718 Self {
719 builder: self.builder.property("hexpand", hexpand),
720 }
721 }
722
723 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
724 Self {
725 builder: self.builder.property("hexpand-set", hexpand_set),
726 }
727 }
728
729 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
730 Self {
731 builder: self
732 .builder
733 .property("layout-manager", layout_manager.clone().upcast()),
734 }
735 }
736
737 #[cfg(feature = "v4_18")]
738 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
739 pub fn limit_events(self, limit_events: bool) -> Self {
740 Self {
741 builder: self.builder.property("limit-events", limit_events),
742 }
743 }
744
745 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
746 Self {
747 builder: self.builder.property("margin-bottom", margin_bottom),
748 }
749 }
750
751 pub fn margin_end(self, margin_end: i32) -> Self {
752 Self {
753 builder: self.builder.property("margin-end", margin_end),
754 }
755 }
756
757 pub fn margin_start(self, margin_start: i32) -> Self {
758 Self {
759 builder: self.builder.property("margin-start", margin_start),
760 }
761 }
762
763 pub fn margin_top(self, margin_top: i32) -> Self {
764 Self {
765 builder: self.builder.property("margin-top", margin_top),
766 }
767 }
768
769 pub fn name(self, name: impl Into<glib::GString>) -> Self {
770 Self {
771 builder: self.builder.property("name", name.into()),
772 }
773 }
774
775 pub fn opacity(self, opacity: f64) -> Self {
776 Self {
777 builder: self.builder.property("opacity", opacity),
778 }
779 }
780
781 pub fn overflow(self, overflow: Overflow) -> Self {
782 Self {
783 builder: self.builder.property("overflow", overflow),
784 }
785 }
786
787 pub fn receives_default(self, receives_default: bool) -> Self {
788 Self {
789 builder: self.builder.property("receives-default", receives_default),
790 }
791 }
792
793 pub fn sensitive(self, sensitive: bool) -> Self {
794 Self {
795 builder: self.builder.property("sensitive", sensitive),
796 }
797 }
798
799 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
800 Self {
801 builder: self
802 .builder
803 .property("tooltip-markup", tooltip_markup.into()),
804 }
805 }
806
807 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
808 Self {
809 builder: self.builder.property("tooltip-text", tooltip_text.into()),
810 }
811 }
812
813 pub fn valign(self, valign: Align) -> Self {
814 Self {
815 builder: self.builder.property("valign", valign),
816 }
817 }
818
819 pub fn vexpand(self, vexpand: bool) -> Self {
820 Self {
821 builder: self.builder.property("vexpand", vexpand),
822 }
823 }
824
825 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
826 Self {
827 builder: self.builder.property("vexpand-set", vexpand_set),
828 }
829 }
830
831 pub fn visible(self, visible: bool) -> Self {
832 Self {
833 builder: self.builder.property("visible", visible),
834 }
835 }
836
837 pub fn width_request(self, width_request: i32) -> Self {
838 Self {
839 builder: self.builder.property("width-request", width_request),
840 }
841 }
842
843 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
844 Self {
845 builder: self.builder.property("accessible-role", accessible_role),
846 }
847 }
848
849 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
852 pub fn build(self) -> Assistant {
853 assert_initialized_main_thread!();
854 self.builder.build()
855 }
856}