1#![allow(deprecated)]
5
6use crate::{
7 ffi, Accessible, AccessibleRole, Align, Buildable, ConstraintTarget, LayoutManager, Overflow,
8 Widget,
9};
10use glib::{
11 object::ObjectType as _,
12 prelude::*,
13 signal::{connect_raw, SignalHandlerId},
14 translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19 #[doc(alias = "GtkCalendar")]
20 pub struct Calendar(Object<ffi::GtkCalendar>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget;
21
22 match fn {
23 type_ => || ffi::gtk_calendar_get_type(),
24 }
25}
26
27impl Calendar {
28 #[doc(alias = "gtk_calendar_new")]
29 pub fn new() -> Calendar {
30 assert_initialized_main_thread!();
31 unsafe { Widget::from_glib_none(ffi::gtk_calendar_new()).unsafe_cast() }
32 }
33
34 pub fn builder() -> CalendarBuilder {
39 CalendarBuilder::new()
40 }
41
42 #[doc(alias = "gtk_calendar_clear_marks")]
43 pub fn clear_marks(&self) {
44 unsafe {
45 ffi::gtk_calendar_clear_marks(self.to_glib_none().0);
46 }
47 }
48
49 #[doc(alias = "gtk_calendar_get_date")]
50 #[doc(alias = "get_date")]
51 pub fn date(&self) -> glib::DateTime {
52 unsafe { from_glib_full(ffi::gtk_calendar_get_date(self.to_glib_none().0)) }
53 }
54
55 #[cfg(feature = "v4_14")]
56 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
57 #[doc(alias = "gtk_calendar_get_day")]
58 #[doc(alias = "get_day")]
59 pub fn day(&self) -> i32 {
60 unsafe { ffi::gtk_calendar_get_day(self.to_glib_none().0) }
61 }
62
63 #[doc(alias = "gtk_calendar_get_day_is_marked")]
64 #[doc(alias = "get_day_is_marked")]
65 pub fn day_is_marked(&self, day: u32) -> bool {
66 unsafe {
67 from_glib(ffi::gtk_calendar_get_day_is_marked(
68 self.to_glib_none().0,
69 day,
70 ))
71 }
72 }
73
74 #[cfg(feature = "v4_14")]
75 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
76 #[doc(alias = "gtk_calendar_get_month")]
77 #[doc(alias = "get_month")]
78 pub fn month(&self) -> i32 {
79 unsafe { ffi::gtk_calendar_get_month(self.to_glib_none().0) }
80 }
81
82 #[doc(alias = "gtk_calendar_get_show_day_names")]
83 #[doc(alias = "get_show_day_names")]
84 #[doc(alias = "show-day-names")]
85 pub fn shows_day_names(&self) -> bool {
86 unsafe { from_glib(ffi::gtk_calendar_get_show_day_names(self.to_glib_none().0)) }
87 }
88
89 #[doc(alias = "gtk_calendar_get_show_heading")]
90 #[doc(alias = "get_show_heading")]
91 #[doc(alias = "show-heading")]
92 pub fn shows_heading(&self) -> bool {
93 unsafe { from_glib(ffi::gtk_calendar_get_show_heading(self.to_glib_none().0)) }
94 }
95
96 #[doc(alias = "gtk_calendar_get_show_week_numbers")]
97 #[doc(alias = "get_show_week_numbers")]
98 #[doc(alias = "show-week-numbers")]
99 pub fn shows_week_numbers(&self) -> bool {
100 unsafe {
101 from_glib(ffi::gtk_calendar_get_show_week_numbers(
102 self.to_glib_none().0,
103 ))
104 }
105 }
106
107 #[cfg(feature = "v4_14")]
108 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
109 #[doc(alias = "gtk_calendar_get_year")]
110 #[doc(alias = "get_year")]
111 pub fn year(&self) -> i32 {
112 unsafe { ffi::gtk_calendar_get_year(self.to_glib_none().0) }
113 }
114
115 #[doc(alias = "gtk_calendar_mark_day")]
116 pub fn mark_day(&self, day: u32) {
117 unsafe {
118 ffi::gtk_calendar_mark_day(self.to_glib_none().0, day);
119 }
120 }
121
122 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
123 #[allow(deprecated)]
124 #[doc(alias = "gtk_calendar_select_day")]
125 pub fn select_day(&self, date: &glib::DateTime) {
126 unsafe {
127 ffi::gtk_calendar_select_day(self.to_glib_none().0, date.to_glib_none().0);
128 }
129 }
130
131 #[cfg(feature = "v4_20")]
132 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
133 #[doc(alias = "gtk_calendar_set_date")]
134 #[doc(alias = "date")]
135 pub fn set_date(&self, date: &glib::DateTime) {
136 unsafe {
137 ffi::gtk_calendar_set_date(self.to_glib_none().0, date.to_glib_none().0);
138 }
139 }
140
141 #[cfg(feature = "v4_14")]
142 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
143 #[doc(alias = "gtk_calendar_set_day")]
144 #[doc(alias = "day")]
145 pub fn set_day(&self, day: i32) {
146 unsafe {
147 ffi::gtk_calendar_set_day(self.to_glib_none().0, day);
148 }
149 }
150
151 #[cfg(feature = "v4_14")]
152 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
153 #[doc(alias = "gtk_calendar_set_month")]
154 #[doc(alias = "month")]
155 pub fn set_month(&self, month: i32) {
156 unsafe {
157 ffi::gtk_calendar_set_month(self.to_glib_none().0, month);
158 }
159 }
160
161 #[doc(alias = "gtk_calendar_set_show_day_names")]
162 #[doc(alias = "show-day-names")]
163 pub fn set_show_day_names(&self, value: bool) {
164 unsafe {
165 ffi::gtk_calendar_set_show_day_names(self.to_glib_none().0, value.into_glib());
166 }
167 }
168
169 #[doc(alias = "gtk_calendar_set_show_heading")]
170 #[doc(alias = "show-heading")]
171 pub fn set_show_heading(&self, value: bool) {
172 unsafe {
173 ffi::gtk_calendar_set_show_heading(self.to_glib_none().0, value.into_glib());
174 }
175 }
176
177 #[doc(alias = "gtk_calendar_set_show_week_numbers")]
178 #[doc(alias = "show-week-numbers")]
179 pub fn set_show_week_numbers(&self, value: bool) {
180 unsafe {
181 ffi::gtk_calendar_set_show_week_numbers(self.to_glib_none().0, value.into_glib());
182 }
183 }
184
185 #[cfg(feature = "v4_14")]
186 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
187 #[doc(alias = "gtk_calendar_set_year")]
188 #[doc(alias = "year")]
189 pub fn set_year(&self, year: i32) {
190 unsafe {
191 ffi::gtk_calendar_set_year(self.to_glib_none().0, year);
192 }
193 }
194
195 #[doc(alias = "gtk_calendar_unmark_day")]
196 pub fn unmark_day(&self, day: u32) {
197 unsafe {
198 ffi::gtk_calendar_unmark_day(self.to_glib_none().0, day);
199 }
200 }
201
202 #[cfg(not(feature = "v4_20"))]
203 #[cfg_attr(docsrs, doc(cfg(not(feature = "v4_20"))))]
204 pub fn set_date(&self, date: Option<&glib::DateTime>) {
205 ObjectExt::set_property(self, "date", date)
206 }
207
208 #[doc(alias = "day-selected")]
209 pub fn connect_day_selected<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
210 unsafe extern "C" fn day_selected_trampoline<F: Fn(&Calendar) + 'static>(
211 this: *mut ffi::GtkCalendar,
212 f: glib::ffi::gpointer,
213 ) {
214 let f: &F = &*(f as *const F);
215 f(&from_glib_borrow(this))
216 }
217 unsafe {
218 let f: Box_<F> = Box_::new(f);
219 connect_raw(
220 self.as_ptr() as *mut _,
221 c"day-selected".as_ptr() as *const _,
222 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
223 day_selected_trampoline::<F> as *const (),
224 )),
225 Box_::into_raw(f),
226 )
227 }
228 }
229
230 #[doc(alias = "next-month")]
231 pub fn connect_next_month<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
232 unsafe extern "C" fn next_month_trampoline<F: Fn(&Calendar) + 'static>(
233 this: *mut ffi::GtkCalendar,
234 f: glib::ffi::gpointer,
235 ) {
236 let f: &F = &*(f as *const F);
237 f(&from_glib_borrow(this))
238 }
239 unsafe {
240 let f: Box_<F> = Box_::new(f);
241 connect_raw(
242 self.as_ptr() as *mut _,
243 c"next-month".as_ptr() as *const _,
244 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
245 next_month_trampoline::<F> as *const (),
246 )),
247 Box_::into_raw(f),
248 )
249 }
250 }
251
252 #[doc(alias = "next-year")]
253 pub fn connect_next_year<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
254 unsafe extern "C" fn next_year_trampoline<F: Fn(&Calendar) + 'static>(
255 this: *mut ffi::GtkCalendar,
256 f: glib::ffi::gpointer,
257 ) {
258 let f: &F = &*(f as *const F);
259 f(&from_glib_borrow(this))
260 }
261 unsafe {
262 let f: Box_<F> = Box_::new(f);
263 connect_raw(
264 self.as_ptr() as *mut _,
265 c"next-year".as_ptr() as *const _,
266 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
267 next_year_trampoline::<F> as *const (),
268 )),
269 Box_::into_raw(f),
270 )
271 }
272 }
273
274 #[doc(alias = "prev-month")]
275 pub fn connect_prev_month<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
276 unsafe extern "C" fn prev_month_trampoline<F: Fn(&Calendar) + 'static>(
277 this: *mut ffi::GtkCalendar,
278 f: glib::ffi::gpointer,
279 ) {
280 let f: &F = &*(f as *const F);
281 f(&from_glib_borrow(this))
282 }
283 unsafe {
284 let f: Box_<F> = Box_::new(f);
285 connect_raw(
286 self.as_ptr() as *mut _,
287 c"prev-month".as_ptr() as *const _,
288 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
289 prev_month_trampoline::<F> as *const (),
290 )),
291 Box_::into_raw(f),
292 )
293 }
294 }
295
296 #[doc(alias = "prev-year")]
297 pub fn connect_prev_year<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
298 unsafe extern "C" fn prev_year_trampoline<F: Fn(&Calendar) + 'static>(
299 this: *mut ffi::GtkCalendar,
300 f: glib::ffi::gpointer,
301 ) {
302 let f: &F = &*(f as *const F);
303 f(&from_glib_borrow(this))
304 }
305 unsafe {
306 let f: Box_<F> = Box_::new(f);
307 connect_raw(
308 self.as_ptr() as *mut _,
309 c"prev-year".as_ptr() as *const _,
310 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
311 prev_year_trampoline::<F> as *const (),
312 )),
313 Box_::into_raw(f),
314 )
315 }
316 }
317
318 #[doc(alias = "date")]
319 pub fn connect_date_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
320 unsafe extern "C" fn notify_date_trampoline<F: Fn(&Calendar) + 'static>(
321 this: *mut ffi::GtkCalendar,
322 _param_spec: glib::ffi::gpointer,
323 f: glib::ffi::gpointer,
324 ) {
325 let f: &F = &*(f as *const F);
326 f(&from_glib_borrow(this))
327 }
328 unsafe {
329 let f: Box_<F> = Box_::new(f);
330 connect_raw(
331 self.as_ptr() as *mut _,
332 c"notify::date".as_ptr() as *const _,
333 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
334 notify_date_trampoline::<F> as *const (),
335 )),
336 Box_::into_raw(f),
337 )
338 }
339 }
340
341 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
342 #[doc(alias = "day")]
343 pub fn connect_day_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
344 unsafe extern "C" fn notify_day_trampoline<F: Fn(&Calendar) + 'static>(
345 this: *mut ffi::GtkCalendar,
346 _param_spec: glib::ffi::gpointer,
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"notify::day".as_ptr() as *const _,
357 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
358 notify_day_trampoline::<F> as *const (),
359 )),
360 Box_::into_raw(f),
361 )
362 }
363 }
364
365 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
366 #[doc(alias = "month")]
367 pub fn connect_month_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
368 unsafe extern "C" fn notify_month_trampoline<F: Fn(&Calendar) + 'static>(
369 this: *mut ffi::GtkCalendar,
370 _param_spec: glib::ffi::gpointer,
371 f: glib::ffi::gpointer,
372 ) {
373 let f: &F = &*(f as *const F);
374 f(&from_glib_borrow(this))
375 }
376 unsafe {
377 let f: Box_<F> = Box_::new(f);
378 connect_raw(
379 self.as_ptr() as *mut _,
380 c"notify::month".as_ptr() as *const _,
381 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
382 notify_month_trampoline::<F> as *const (),
383 )),
384 Box_::into_raw(f),
385 )
386 }
387 }
388
389 #[doc(alias = "show-day-names")]
390 pub fn connect_show_day_names_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
391 unsafe extern "C" fn notify_show_day_names_trampoline<F: Fn(&Calendar) + 'static>(
392 this: *mut ffi::GtkCalendar,
393 _param_spec: glib::ffi::gpointer,
394 f: glib::ffi::gpointer,
395 ) {
396 let f: &F = &*(f as *const F);
397 f(&from_glib_borrow(this))
398 }
399 unsafe {
400 let f: Box_<F> = Box_::new(f);
401 connect_raw(
402 self.as_ptr() as *mut _,
403 c"notify::show-day-names".as_ptr() as *const _,
404 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
405 notify_show_day_names_trampoline::<F> as *const (),
406 )),
407 Box_::into_raw(f),
408 )
409 }
410 }
411
412 #[doc(alias = "show-heading")]
413 pub fn connect_show_heading_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
414 unsafe extern "C" fn notify_show_heading_trampoline<F: Fn(&Calendar) + 'static>(
415 this: *mut ffi::GtkCalendar,
416 _param_spec: glib::ffi::gpointer,
417 f: glib::ffi::gpointer,
418 ) {
419 let f: &F = &*(f as *const F);
420 f(&from_glib_borrow(this))
421 }
422 unsafe {
423 let f: Box_<F> = Box_::new(f);
424 connect_raw(
425 self.as_ptr() as *mut _,
426 c"notify::show-heading".as_ptr() as *const _,
427 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
428 notify_show_heading_trampoline::<F> as *const (),
429 )),
430 Box_::into_raw(f),
431 )
432 }
433 }
434
435 #[doc(alias = "show-week-numbers")]
436 pub fn connect_show_week_numbers_notify<F: Fn(&Self) + 'static>(
437 &self,
438 f: F,
439 ) -> SignalHandlerId {
440 unsafe extern "C" fn notify_show_week_numbers_trampoline<F: Fn(&Calendar) + 'static>(
441 this: *mut ffi::GtkCalendar,
442 _param_spec: glib::ffi::gpointer,
443 f: glib::ffi::gpointer,
444 ) {
445 let f: &F = &*(f as *const F);
446 f(&from_glib_borrow(this))
447 }
448 unsafe {
449 let f: Box_<F> = Box_::new(f);
450 connect_raw(
451 self.as_ptr() as *mut _,
452 c"notify::show-week-numbers".as_ptr() as *const _,
453 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
454 notify_show_week_numbers_trampoline::<F> as *const (),
455 )),
456 Box_::into_raw(f),
457 )
458 }
459 }
460
461 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
462 #[doc(alias = "year")]
463 pub fn connect_year_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
464 unsafe extern "C" fn notify_year_trampoline<F: Fn(&Calendar) + 'static>(
465 this: *mut ffi::GtkCalendar,
466 _param_spec: glib::ffi::gpointer,
467 f: glib::ffi::gpointer,
468 ) {
469 let f: &F = &*(f as *const F);
470 f(&from_glib_borrow(this))
471 }
472 unsafe {
473 let f: Box_<F> = Box_::new(f);
474 connect_raw(
475 self.as_ptr() as *mut _,
476 c"notify::year".as_ptr() as *const _,
477 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
478 notify_year_trampoline::<F> as *const (),
479 )),
480 Box_::into_raw(f),
481 )
482 }
483 }
484}
485
486impl Default for Calendar {
487 fn default() -> Self {
488 Self::new()
489 }
490}
491
492#[must_use = "The builder must be built to be used"]
497pub struct CalendarBuilder {
498 builder: glib::object::ObjectBuilder<'static, Calendar>,
499}
500
501impl CalendarBuilder {
502 fn new() -> Self {
503 Self {
504 builder: glib::object::Object::builder(),
505 }
506 }
507
508 pub fn date(self, date: &glib::DateTime) -> Self {
509 Self {
510 builder: self.builder.property("date", date.clone()),
511 }
512 }
513
514 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
515 pub fn day(self, day: i32) -> Self {
516 Self {
517 builder: self.builder.property("day", day),
518 }
519 }
520
521 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
522 pub fn month(self, month: i32) -> Self {
523 Self {
524 builder: self.builder.property("month", month),
525 }
526 }
527
528 pub fn show_day_names(self, show_day_names: bool) -> Self {
529 Self {
530 builder: self.builder.property("show-day-names", show_day_names),
531 }
532 }
533
534 pub fn show_heading(self, show_heading: bool) -> Self {
535 Self {
536 builder: self.builder.property("show-heading", show_heading),
537 }
538 }
539
540 pub fn show_week_numbers(self, show_week_numbers: bool) -> Self {
541 Self {
542 builder: self
543 .builder
544 .property("show-week-numbers", show_week_numbers),
545 }
546 }
547
548 #[cfg_attr(feature = "v4_20", deprecated = "Since 4.20")]
549 pub fn year(self, year: i32) -> Self {
550 Self {
551 builder: self.builder.property("year", year),
552 }
553 }
554
555 pub fn can_focus(self, can_focus: bool) -> Self {
556 Self {
557 builder: self.builder.property("can-focus", can_focus),
558 }
559 }
560
561 pub fn can_target(self, can_target: bool) -> Self {
562 Self {
563 builder: self.builder.property("can-target", can_target),
564 }
565 }
566
567 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
568 Self {
569 builder: self.builder.property("css-classes", css_classes.into()),
570 }
571 }
572
573 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
574 Self {
575 builder: self.builder.property("css-name", css_name.into()),
576 }
577 }
578
579 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
580 Self {
581 builder: self.builder.property("cursor", cursor.clone()),
582 }
583 }
584
585 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
586 Self {
587 builder: self.builder.property("focus-on-click", focus_on_click),
588 }
589 }
590
591 pub fn focusable(self, focusable: bool) -> Self {
592 Self {
593 builder: self.builder.property("focusable", focusable),
594 }
595 }
596
597 pub fn halign(self, halign: Align) -> Self {
598 Self {
599 builder: self.builder.property("halign", halign),
600 }
601 }
602
603 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
604 Self {
605 builder: self.builder.property("has-tooltip", has_tooltip),
606 }
607 }
608
609 pub fn height_request(self, height_request: i32) -> Self {
610 Self {
611 builder: self.builder.property("height-request", height_request),
612 }
613 }
614
615 pub fn hexpand(self, hexpand: bool) -> Self {
616 Self {
617 builder: self.builder.property("hexpand", hexpand),
618 }
619 }
620
621 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
622 Self {
623 builder: self.builder.property("hexpand-set", hexpand_set),
624 }
625 }
626
627 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
628 Self {
629 builder: self
630 .builder
631 .property("layout-manager", layout_manager.clone().upcast()),
632 }
633 }
634
635 #[cfg(feature = "v4_18")]
636 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
637 pub fn limit_events(self, limit_events: bool) -> Self {
638 Self {
639 builder: self.builder.property("limit-events", limit_events),
640 }
641 }
642
643 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
644 Self {
645 builder: self.builder.property("margin-bottom", margin_bottom),
646 }
647 }
648
649 pub fn margin_end(self, margin_end: i32) -> Self {
650 Self {
651 builder: self.builder.property("margin-end", margin_end),
652 }
653 }
654
655 pub fn margin_start(self, margin_start: i32) -> Self {
656 Self {
657 builder: self.builder.property("margin-start", margin_start),
658 }
659 }
660
661 pub fn margin_top(self, margin_top: i32) -> Self {
662 Self {
663 builder: self.builder.property("margin-top", margin_top),
664 }
665 }
666
667 pub fn name(self, name: impl Into<glib::GString>) -> Self {
668 Self {
669 builder: self.builder.property("name", name.into()),
670 }
671 }
672
673 pub fn opacity(self, opacity: f64) -> Self {
674 Self {
675 builder: self.builder.property("opacity", opacity),
676 }
677 }
678
679 pub fn overflow(self, overflow: Overflow) -> Self {
680 Self {
681 builder: self.builder.property("overflow", overflow),
682 }
683 }
684
685 pub fn receives_default(self, receives_default: bool) -> Self {
686 Self {
687 builder: self.builder.property("receives-default", receives_default),
688 }
689 }
690
691 pub fn sensitive(self, sensitive: bool) -> Self {
692 Self {
693 builder: self.builder.property("sensitive", sensitive),
694 }
695 }
696
697 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
698 Self {
699 builder: self
700 .builder
701 .property("tooltip-markup", tooltip_markup.into()),
702 }
703 }
704
705 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
706 Self {
707 builder: self.builder.property("tooltip-text", tooltip_text.into()),
708 }
709 }
710
711 pub fn valign(self, valign: Align) -> Self {
712 Self {
713 builder: self.builder.property("valign", valign),
714 }
715 }
716
717 pub fn vexpand(self, vexpand: bool) -> Self {
718 Self {
719 builder: self.builder.property("vexpand", vexpand),
720 }
721 }
722
723 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
724 Self {
725 builder: self.builder.property("vexpand-set", vexpand_set),
726 }
727 }
728
729 pub fn visible(self, visible: bool) -> Self {
730 Self {
731 builder: self.builder.property("visible", visible),
732 }
733 }
734
735 pub fn width_request(self, width_request: i32) -> Self {
736 Self {
737 builder: self.builder.property("width-request", width_request),
738 }
739 }
740
741 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
742 Self {
743 builder: self.builder.property("accessible-role", accessible_role),
744 }
745 }
746
747 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
750 pub fn build(self) -> Calendar {
751 assert_initialized_main_thread!();
752 self.builder.build()
753 }
754}