pub trait WidgetExt: 'static {
Show 325 methods fn activate(&self) -> bool; fn add_accelerator(
        &self,
        accel_signal: &str,
        accel_group: &impl IsA<AccelGroup>,
        accel_key: u32,
        accel_mods: ModifierType,
        accel_flags: AccelFlags
    ); fn add_device_events(&self, device: &Device, events: EventMask); fn add_mnemonic_label(&self, label: &impl IsA<Widget>); fn can_activate_accel(&self, signal_id: u32) -> bool; fn child_focus(&self, direction: DirectionType) -> bool; fn child_notify(&self, child_property: &str); fn compute_expand(&self, orientation: Orientation) -> bool; fn create_pango_context(&self) -> Context; fn create_pango_layout(&self, text: Option<&str>) -> Layout; fn device_is_shadowed(&self, device: &Device) -> bool; fn drag_begin_with_coordinates(
        &self,
        targets: &TargetList,
        actions: DragAction,
        button: i32,
        event: Option<&Event>,
        x: i32,
        y: i32
    ) -> Option<DragContext>; fn drag_check_threshold(
        &self,
        start_x: i32,
        start_y: i32,
        current_x: i32,
        current_y: i32
    ) -> bool; fn drag_dest_add_image_targets(&self); fn drag_dest_add_text_targets(&self); fn drag_dest_add_uri_targets(&self); fn drag_dest_find_target(
        &self,
        context: &DragContext,
        target_list: Option<&TargetList>
    ) -> Option<Atom>; fn drag_dest_get_target_list(&self) -> Option<TargetList>; fn drag_dest_get_track_motion(&self) -> bool; fn drag_dest_set_proxy(
        &self,
        proxy_window: &Window,
        protocol: DragProtocol,
        use_coordinates: bool
    ); fn drag_dest_set_target_list(&self, target_list: Option<&TargetList>); fn drag_dest_set_track_motion(&self, track_motion: bool); fn drag_dest_unset(&self); fn drag_get_data(&self, context: &DragContext, target: &Atom, time_: u32); fn drag_highlight(&self); fn drag_source_add_image_targets(&self); fn drag_source_add_text_targets(&self); fn drag_source_add_uri_targets(&self); fn drag_source_get_target_list(&self) -> Option<TargetList>; fn drag_source_set_icon_gicon(&self, icon: &impl IsA<Icon>); fn drag_source_set_icon_name(&self, icon_name: &str); fn drag_source_set_icon_pixbuf(&self, pixbuf: &Pixbuf); fn drag_source_set_target_list(&self, target_list: Option<&TargetList>); fn drag_source_unset(&self); fn drag_unhighlight(&self); fn draw(&self, cr: &Context); fn error_bell(&self); fn event(&self, event: &Event) -> bool; fn freeze_child_notify(&self); fn accessible(&self) -> Option<Object>; fn action_group(&self, prefix: &str) -> Option<ActionGroup>; fn allocated_baseline(&self) -> i32; fn allocated_height(&self) -> i32; fn allocated_size(&self) -> (Allocation, i32); fn allocated_width(&self) -> i32; fn allocation(&self) -> Allocation; fn ancestor(&self, widget_type: Type) -> Option<Widget>; fn is_app_paintable(&self) -> bool; fn can_default(&self) -> bool; fn can_focus(&self) -> bool; fn is_child_visible(&self) -> bool; fn clip(&self) -> Allocation; fn clipboard(&self, selection: &Atom) -> Clipboard; fn device_is_enabled(&self, device: &Device) -> bool; fn device_events(&self, device: &Device) -> EventMask; fn direction(&self) -> TextDirection; fn display(&self) -> Display; fn is_double_buffered(&self) -> bool; fn gets_focus_on_click(&self) -> bool; fn font_map(&self) -> Option<FontMap>; fn font_options(&self) -> Option<FontOptions>; fn frame_clock(&self) -> Option<FrameClock>; fn halign(&self) -> Align; fn has_tooltip(&self) -> bool; fn has_window(&self) -> bool; fn hexpands(&self) -> bool; fn is_hexpand_set(&self) -> bool; fn is_mapped(&self) -> bool; fn margin_bottom(&self) -> i32; fn margin_end(&self) -> i32; fn margin_start(&self) -> i32; fn margin_top(&self) -> i32; fn modifier_mask(&self, intent: ModifierIntent) -> ModifierType; fn widget_name(&self) -> GString; fn is_no_show_all(&self) -> bool; fn opacity(&self) -> f64; fn pango_context(&self) -> Context; fn parent(&self) -> Option<Widget>; fn parent_window(&self) -> Option<Window>; fn path(&self) -> WidgetPath; fn preferred_height(&self) -> (i32, i32); fn preferred_height_and_baseline_for_width(
        &self,
        width: i32
    ) -> (i32, i32, i32, i32); fn preferred_height_for_width(&self, width: i32) -> (i32, i32); fn preferred_size(&self) -> (Requisition, Requisition); fn preferred_width(&self) -> (i32, i32); fn preferred_width_for_height(&self, height: i32) -> (i32, i32); fn is_realized(&self) -> bool; fn receives_default(&self) -> bool; fn request_mode(&self) -> SizeRequestMode; fn scale_factor(&self) -> i32; fn screen(&self) -> Option<Screen>; fn get_sensitive(&self) -> bool; fn settings(&self) -> Option<Settings>; fn size_request(&self) -> (i32, i32); fn state_flags(&self) -> StateFlags; fn style_context(&self) -> StyleContext; fn supports_multidevice(&self) -> bool; fn template_child(&self, widget_type: Type, name: &str) -> Option<Object>; fn tooltip_markup(&self) -> Option<GString>; fn tooltip_text(&self) -> Option<GString>; fn tooltip_window(&self) -> Option<Window>; fn toplevel(&self) -> Option<Widget>; fn valign(&self) -> Align; fn valign_with_baseline(&self) -> Align; fn vexpands(&self) -> bool; fn is_vexpand_set(&self) -> bool; fn get_visible(&self) -> bool; fn visual(&self) -> Option<Visual>; fn window(&self) -> Option<Window>; fn grab_add(&self); fn grab_default(&self); fn grab_focus(&self); fn grab_remove(&self); fn has_default(&self) -> bool; fn has_focus(&self) -> bool; fn has_grab(&self) -> bool; fn has_screen(&self) -> bool; fn has_visible_focus(&self) -> bool; fn hide(&self); fn in_destruction(&self) -> bool; fn init_template(&self); fn input_shape_combine_region(&self, region: Option<&Region>); fn insert_action_group(
        &self,
        name: &str,
        group: Option<&impl IsA<ActionGroup>>
    ); fn is_ancestor(&self, ancestor: &impl IsA<Widget>) -> bool; fn is_composited(&self) -> bool; fn is_drawable(&self) -> bool; fn is_focus(&self) -> bool; fn is_sensitive(&self) -> bool; fn is_toplevel(&self) -> bool; fn is_visible(&self) -> bool; fn keynav_failed(&self, direction: DirectionType) -> bool; fn list_accel_closures(&self) -> Vec<Closure>; fn list_action_prefixes(&self) -> Vec<GString>; fn list_mnemonic_labels(&self) -> Vec<Widget>; fn map(&self); fn mnemonic_activate(&self, group_cycling: bool) -> bool; fn queue_allocate(&self); fn queue_compute_expand(&self); fn queue_draw(&self); fn queue_draw_area(&self, x: i32, y: i32, width: i32, height: i32); fn queue_draw_region(&self, region: &Region); fn queue_resize(&self); fn queue_resize_no_redraw(&self); fn realize(&self); fn register_window(&self, window: &Window); fn remove_accelerator(
        &self,
        accel_group: &impl IsA<AccelGroup>,
        accel_key: u32,
        accel_mods: ModifierType
    ) -> bool; fn remove_mnemonic_label(&self, label: &impl IsA<Widget>); fn reset_style(&self); fn send_expose(&self, event: &Event) -> i32; fn send_focus_change(&self, event: &Event) -> bool; fn set_accel_path(
        &self,
        accel_path: Option<&str>,
        accel_group: Option<&impl IsA<AccelGroup>>
    ); fn set_allocation(&self, allocation: &Allocation); fn set_app_paintable(&self, app_paintable: bool); fn set_can_default(&self, can_default: bool); fn set_can_focus(&self, can_focus: bool); fn set_child_visible(&self, is_visible: bool); fn set_clip(&self, clip: &Allocation); fn set_device_enabled(&self, device: &Device, enabled: bool); fn set_device_events(&self, device: &Device, events: EventMask); fn set_direction(&self, dir: TextDirection); fn set_focus_on_click(&self, focus_on_click: bool); fn set_font_map(&self, font_map: Option<&impl IsA<FontMap>>); fn set_font_options(&self, options: Option<&FontOptions>); fn set_halign(&self, align: Align); fn set_has_tooltip(&self, has_tooltip: bool); fn set_has_window(&self, has_window: bool); fn set_hexpand(&self, expand: bool); fn set_hexpand_set(&self, set: bool); fn set_mapped(&self, mapped: bool); fn set_margin_bottom(&self, margin: i32); fn set_margin_end(&self, margin: i32); fn set_margin_start(&self, margin: i32); fn set_margin_top(&self, margin: i32); fn set_widget_name(&self, name: &str); fn set_no_show_all(&self, no_show_all: bool); fn set_opacity(&self, opacity: f64); fn set_parent(&self, parent: &impl IsA<Widget>); fn set_parent_window(&self, parent_window: &Window); fn set_realized(&self, realized: bool); fn set_receives_default(&self, receives_default: bool); fn set_redraw_on_allocate(&self, redraw_on_allocate: bool); fn set_sensitive(&self, sensitive: bool); fn set_size_request(&self, width: i32, height: i32); fn set_state_flags(&self, flags: StateFlags, clear: bool); fn set_support_multidevice(&self, support_multidevice: bool); fn set_tooltip_markup(&self, markup: Option<&str>); fn set_tooltip_text(&self, text: Option<&str>); fn set_tooltip_window(&self, custom_window: Option<&impl IsA<Window>>); fn set_valign(&self, align: Align); fn set_vexpand(&self, expand: bool); fn set_vexpand_set(&self, set: bool); fn set_visible(&self, visible: bool); fn set_visual(&self, visual: Option<&Visual>); fn set_window(&self, window: &Window); fn shape_combine_region(&self, region: Option<&Region>); fn show(&self); fn show_all(&self); fn show_now(&self); fn size_allocate(&self, allocation: &Allocation); fn size_allocate_with_baseline(
        &self,
        allocation: &mut Allocation,
        baseline: i32
    ); fn style_get_property(&self, property_name: &str) -> Value; fn thaw_child_notify(&self); fn translate_coordinates(
        &self,
        dest_widget: &impl IsA<Widget>,
        src_x: i32,
        src_y: i32
    ) -> Option<(i32, i32)>; fn trigger_tooltip_query(&self); fn unmap(&self); fn unparent(&self); fn unrealize(&self); fn unregister_window(&self, window: &Window); fn unset_state_flags(&self, flags: StateFlags); fn is_composite_child(&self) -> bool; fn expands(&self) -> bool; fn set_expand(&self, expand: bool); fn set_has_default(&self, has_default: bool); fn set_has_focus(&self, has_focus: bool); fn height_request(&self) -> i32; fn set_height_request(&self, height_request: i32); fn set_is_focus(&self, is_focus: bool); fn margin(&self) -> i32; fn set_margin(&self, margin: i32); fn width_request(&self) -> i32; fn set_width_request(&self, width_request: i32); fn connect_accel_closures_changed<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_button_press_event<F: Fn(&Self, &EventButton) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_button_release_event<F: Fn(&Self, &EventButton) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_can_activate_accel<F: Fn(&Self, u32) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_child_notify<F: Fn(&Self, &ParamSpec) + 'static>(
        &self,
        detail: Option<&str>,
        f: F
    ) -> SignalHandlerId; fn connect_composited_changed<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn emit_composited_changed(&self); fn connect_configure_event<F: Fn(&Self, &EventConfigure) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_damage_event<F: Fn(&Self, &EventExpose) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_delete_event<F: Fn(&Self, &Event) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_destroy<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_destroy_event<F: Fn(&Self, &Event) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_direction_changed<F: Fn(&Self, TextDirection) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_begin<F: Fn(&Self, &DragContext) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_data_delete<F: Fn(&Self, &DragContext) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_data_get<F: Fn(&Self, &DragContext, &SelectionData, u32, u32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_data_received<F: Fn(&Self, &DragContext, i32, i32, &SelectionData, u32, u32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_drop<F: Fn(&Self, &DragContext, i32, i32, u32) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_end<F: Fn(&Self, &DragContext) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_failed<F: Fn(&Self, &DragContext, DragResult) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_leave<F: Fn(&Self, &DragContext, u32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_drag_motion<F: Fn(&Self, &DragContext, i32, i32, u32) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_draw<F: Fn(&Self, &Context) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_enter_notify_event<F: Fn(&Self, &EventCrossing) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_event<F: Fn(&Self, &Event) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_event_after<F: Fn(&Self, &Event) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_focus<F: Fn(&Self, DirectionType) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_focus_in_event<F: Fn(&Self, &EventFocus) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_focus_out_event<F: Fn(&Self, &EventFocus) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_grab_broken_event<F: Fn(&Self, &EventGrabBroken) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_grab_focus<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn emit_grab_focus(&self); fn connect_grab_notify<F: Fn(&Self, bool) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_hide<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_hierarchy_changed<F: Fn(&Self, Option<&Widget>) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_key_press_event<F: Fn(&Self, &EventKey) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_key_release_event<F: Fn(&Self, &EventKey) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_keynav_failed<F: Fn(&Self, DirectionType) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_leave_notify_event<F: Fn(&Self, &EventCrossing) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_map<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_mnemonic_activate<F: Fn(&Self, bool) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_motion_notify_event<F: Fn(&Self, &EventMotion) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_move_focus<F: Fn(&Self, DirectionType) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn emit_move_focus(&self, direction: DirectionType); fn connect_parent_set<F: Fn(&Self, Option<&Widget>) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_popup_menu<F: Fn(&Self) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn emit_popup_menu(&self) -> bool; fn connect_property_notify_event<F: Fn(&Self, &EventProperty) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_proximity_in_event<F: Fn(&Self, &EventProximity) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_proximity_out_event<F: Fn(&Self, &EventProximity) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_query_tooltip<F: Fn(&Self, i32, i32, bool, &Tooltip) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_realize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_screen_changed<F: Fn(&Self, Option<&Screen>) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_scroll_event<F: Fn(&Self, &EventScroll) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_selection_clear_event<F: Fn(&Self, &EventSelection) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_selection_get<F: Fn(&Self, &SelectionData, u32, u32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_selection_notify_event<F: Fn(&Self, &EventSelection) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_selection_received<F: Fn(&Self, &SelectionData, u32) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_selection_request_event<F: Fn(&Self, &EventSelection) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_show<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_show_help<F: Fn(&Self, WidgetHelpType) -> bool + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn emit_show_help(&self, help_type: WidgetHelpType) -> bool; fn connect_size_allocate<F: Fn(&Self, &Allocation) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_state_flags_changed<F: Fn(&Self, StateFlags) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_style_updated<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_touch_event<F: Fn(&Self, &Event) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_unmap<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_unrealize<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; fn connect_window_state_event<F: Fn(&Self, &EventWindowState) -> Inhibit + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_app_paintable_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_can_default_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_can_focus_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_composite_child_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_events_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_expand_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_focus_on_click_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_halign_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_has_default_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_has_focus_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_has_tooltip_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_height_request_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_hexpand_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_hexpand_set_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_is_focus_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_margin_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_margin_bottom_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_margin_end_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_margin_start_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_margin_top_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_name_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_no_show_all_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_opacity_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_parent_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_receives_default_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_scale_factor_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_sensitive_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_tooltip_markup_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_tooltip_text_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_valign_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_vexpand_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_vexpand_set_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_visible_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_width_request_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; fn connect_window_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
}
Expand description

Required Methods

For widgets that can be “activated” (buttons, menu items, etc.) this function activates them. Activation is what happens when you press Enter on a widget during key navigation. If self isn’t activatable, the function returns false.

Returns

true if the widget was activatable

Installs an accelerator for this self in accel_group that causes accel_signal to be emitted if the accelerator is activated. The accel_group needs to be added to the widget’s toplevel via GtkWindowExt::add_accel_group(), and the signal must be of type G_SIGNAL_ACTION. Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use gtk_accel_map_add_entry() and set_accel_path() or GtkMenuItemExt::set_accel_path() instead.

accel_signal

widget signal to emit on accelerator activation

accel_group

accel group for this widget, added to its toplevel

accel_key

GDK keyval of the accelerator

accel_mods

modifier key combination of the accelerator

accel_flags

flag accelerators, e.g. AccelFlags::VISIBLE

Adds the device events in the bitfield events to the event mask for self. See set_device_events() for details.

device

a gdk::Device

events

an event mask, see gdk::EventMask

Adds a widget to the list of mnemonic labels for this widget. (See list_mnemonic_labels()). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well, by using a connection to the signal::Widget::destroy signal or a weak notifier.

label

a Widget that acts as a mnemonic label for self

Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This is done by emitting the signal::Widget::can-activate-accel signal on self; if the signal isn’t overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped.

signal_id

the ID of a signal installed on self

Returns

true if the accelerator can be activated.

This function is used by custom widget implementations; if you’re writing an app, you’d use grab_focus() to move the focus to a particular widget, and ContainerExt::set_focus_chain() to change the focus tab order. So you may want to investigate those functions instead.

child_focus() is called by containers as the user moves around the window using keyboard shortcuts. direction indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward). child_focus() emits the signal::Widget::focus signal; widgets override the default handler for this signal in order to implement appropriate focus behavior.

The default ::focus handler for a widget should return true if moving in direction left the focus on a focusable location inside that widget, and false if moving in direction moved the focus outside the widget. If returning true, widgets normally call grab_focus() to place the focus accordingly; if returning false, they don’t modify the current focus location.

direction

direction of focus movement

Returns

true if focus ended up inside self

Emits a signal::Widget::child-notify signal for the [child property][child-properties] child_property on self.

This is the analogue of [ObjectExtManual::notify()][crate::glib::prelude::ObjectExtManual::notify()] for child properties.

Also see ContainerExt::child_notify().

child_property

the name of a child property installed on the class of self’s parent

Computes whether a container should give this widget extra space when possible. Containers should check this, rather than looking at hexpands() or vexpands().

This function already checks whether the widget is visible, so visibility does not need to be checked separately. Non-visible widgets are not expanded.

The computed expand value uses either the expand setting explicitly set on the widget itself, or, if none has been explicitly set, the widget may expand if some of its children do.

orientation

expand direction

Returns

whether widget tree rooted here should be expanded

Creates a new pango::Context with the appropriate font map, font options, font description, and base direction for drawing text for this widget. See also pango_context().

Returns

the new pango::Context

Creates a new pango::Layout with the appropriate font map, font description, and base direction for drawing text for this widget.

If you keep a pango::Layout created in this way around, you need to re-create it when the widget pango::Context is replaced. This can be tracked by using the signal::Widget::screen-changed signal on the widget.

text

text to set on the layout (can be None)

Returns

the new pango::Layout

Returns true if device has been shadowed by a GTK+ device grab on another widget, so it would stop sending events to self. This may be used in the signal::Widget::grab-notify signal to check for specific devices. See device_grab_add().

device

a gdk::Device

Returns

true if there is an ongoing grab on device by another Widget than self.

Initiates a drag on the source side. The function only needs to be used when the application is starting drags itself, and is not needed when WidgetExtManual::drag_source_set() is used.

The event is used to retrieve the timestamp that will be used internally to grab the pointer. If event is None, then GDK_CURRENT_TIME will be used. However, you should try to pass a real event in all cases, since that can be used to get information about the drag.

Generally there are three cases when you want to start a drag by hand by calling this function:

  1. During a signal::Widget::button-press-event handler, if you want to start a drag immediately when the user presses the mouse button. Pass the event that you have in your signal::Widget::button-press-event handler.

  2. During a signal::Widget::motion-notify-event handler, if you want to start a drag when the mouse moves past a certain threshold distance after a button-press. Pass the event that you have in your signal::Widget::motion-notify-event handler.

  3. During a timeout handler, if you want to start a drag after the mouse button is held down for some time. Try to save the last event that you got from the mouse, using gdk_event_copy(), and pass it to this function (remember to free the event with gdk_event_free() when you are done). If you really cannot pass a real event, pass None instead.

targets

The targets (data formats) in which the source can provide the data

actions

A bitmask of the allowed drag actions for this drag

button

The button the user clicked to start the drag

event

The event that triggered the start of the drag, or None if none can be obtained.

x

The initial x coordinate to start dragging from, in the coordinate space of self. If -1 is passed, the coordinates are retrieved from event or the current pointer position

y

The initial y coordinate to start dragging from, in the coordinate space of self. If -1 is passed, the coordinates are retrieved from event or the current pointer position

Returns

the context for this drag

Checks to see if a mouse drag starting at (start_x, start_y) and ending at (current_x, current_y) has passed the GTK+ drag threshold, and thus should trigger the beginning of a drag-and-drop operation.

start_x

X coordinate of start of drag

start_y

Y coordinate of start of drag

current_x

current X coordinate

current_y

current Y coordinate

Returns

true if the drag threshold has been passed.

Add the image targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use TargetList::add_image_targets() and drag_dest_set_target_list().

Add the text targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use TargetList::add_text_targets() and drag_dest_set_target_list().

Add the URI targets supported by SelectionData to the target list of the drag destination. The targets are added with info = 0. If you need another value, use TargetList::add_uri_targets() and drag_dest_set_target_list().

Looks for a match between the supported targets of context and the dest_target_list, returning the first matching target, otherwise returning GDK_NONE. dest_target_list should usually be the return value from drag_dest_get_target_list(), but some widgets may have different valid targets for different parts of the widget; in that case, they will have to implement a drag_motion handler that passes the correct target list to this function.

context

drag context

target_list

list of droppable targets, or None to use gtk_drag_dest_get_target_list (self).

Returns

first target that the source offers and the dest can accept, or GDK_NONE

Returns the list of targets this widget can accept from drag-and-drop.

Returns

the TargetList, or None if none

Returns whether the widget has been configured to always emit signal::Widget::drag-motion signals.

Returns

true if the widget always emits signal::Widget::drag-motion events

Sets this widget as a proxy for drops to another window.

Deprecated since 3.22
proxy_window

the window to which to forward drag events

protocol

the drag protocol which the proxy_window accepts (You can use gdk_drag_get_protocol() to determine this)

use_coordinates

If true, send the same coordinates to the destination, because it is an embedded subwindow.

Sets the target types that this widget can accept from drag-and-drop. The widget must first be made into a drag destination with WidgetExtManual::drag_dest_set().

target_list

list of droppable targets, or None for none

Tells the widget to emit signal::Widget::drag-motion and signal::Widget::drag-leave events regardless of the targets and the DestDefaults::MOTION flag.

This may be used when a widget wants to do generic actions regardless of the targets that the source offers.

track_motion

whether to accept all targets

Clears information about a drop destination set with WidgetExtManual::drag_dest_set(). The widget will no longer receive notification of drags.

Gets the data associated with a drag. When the data is received or the retrieval fails, GTK+ will emit a signal::Widget::drag-data-received signal. Failure of the retrieval is indicated by the length field of the selection_data signal parameter being negative. However, when drag_get_data() is called implicitely because the DestDefaults::DROP was set, then the widget will not receive notification of failed drops.

context

the drag context

target

the target (form of the data) to retrieve

time_

a timestamp for retrieving the data. This will generally be the time received in a signal::Widget::drag-motion or signal::Widget::drag-drop signal

Highlights a widget as a currently hovered drop target. To end the highlight, call drag_unhighlight(). GTK+ calls this automatically if DestDefaults::HIGHLIGHT is set.

Add the writable image targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use TargetList::add_image_targets() and drag_source_set_target_list().

Add the text targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use TargetList::add_text_targets() and drag_source_set_target_list().

Add the URI targets supported by SelectionData to the target list of the drag source. The targets are added with info = 0. If you need another value, use TargetList::add_uri_targets() and drag_source_set_target_list().

Gets the list of targets this widget can provide for drag-and-drop.

Returns

the TargetList, or None if none

Sets the icon that will be used for drags from a particular source to icon. See the docs for IconTheme for more details.

icon

A gio::Icon

Sets the icon that will be used for drags from a particular source to a themed icon. See the docs for IconTheme for more details.

icon_name

name of icon to use

Sets the icon that will be used for drags from a particular widget from a gdk_pixbuf::Pixbuf. GTK+ retains a reference for pixbuf and will release it when it is no longer needed.

pixbuf

the gdk_pixbuf::Pixbuf for the drag icon

Changes the target types that this widget offers for drag-and-drop. The widget must first be made into a drag source with WidgetExtManual::drag_source_set().

target_list

list of draggable targets, or None for none

Undoes the effects of WidgetExtManual::drag_source_set().

Removes a highlight set by drag_highlight() from a widget.

Draws self to cr. The top left corner of the widget will be drawn to the currently set origin point of cr.

You should pass a cairo context as cr argument that is in an original state. Otherwise the resulting drawing is undefined. For example changing the operator using cairo_set_operator() or the line width using cairo_set_line_width() might have unwanted side effects. You may however change the context’s transform matrix - like with cairo_scale(), cairo_translate() or cairo_set_matrix() and clip region with cairo_clip() prior to calling this function. Also, it is fine to modify the context with cairo_save() and cairo_push_group() prior to calling this function.

Note that special-purpose widgets may contain special code for rendering to the screen and might appear differently on screen and when rendered using draw().

cr

a cairo context to draw to

Notifies the user about an input-related error on this widget. If the property::Settings::gtk-error-bell setting is true, it calls Window::beep(), otherwise it does nothing.

Note that the effect of Window::beep() can be configured in many ways, depending on the windowing backend and the desktop environment or window manager that is used.

Rarely-used function. This function is used to emit the event signals on a widget (those signals should never be emitted without using this function to do so). If you want to synthesize an event though, don’t use this function; instead, use main_do_event() so the event will behave as if it were in the event queue. Don’t synthesize expose events; instead, use Window::invalidate_rect() to invalidate a region of the window.

event

a GdkEvent

Returns

return from the event signal emission (true if the event was handled)

Stops emission of signal::Widget::child-notify signals on self. The signals are queued until thaw_child_notify() is called on self.

This is the analogue of [ObjectExtManual::freeze_notify()][crate::glib::prelude::ObjectExtManual::freeze_notify()] for child properties.

Returns the accessible object that describes the widget to an assistive technology.

If accessibility support is not available, this atk::Object instance may be a no-op. Likewise, if no class-specific atk::Object implementation is available for the widget instance in question, it will inherit an atk::Object implementation from the first ancestor class for which such an implementation is defined.

The documentation of the ATK library contains more information about accessible objects and their uses.

Returns

the atk::Object associated with self

Retrieves the gio::ActionGroup that was registered using prefix. The resulting gio::ActionGroup may have been registered to self or any Widget in its ancestry.

If no action group was found matching prefix, then None is returned.

prefix

The “prefix” of the action group.

Returns

A gio::ActionGroup or None.

Returns the baseline that has currently been allocated to self. This function is intended to be used when implementing handlers for the signal::Widget::draw function, and when allocating child widgets in signal::Widget::size_allocate.

Returns

the baseline of the self, or -1 if none

Returns the height that has currently been allocated to self. This function is intended to be used when implementing handlers for the signal::Widget::draw function.

Returns

the height of the self

Available on crate feature v3_20 only.

Retrieves the widget’s allocated size.

This function returns the last values passed to size_allocate_with_baseline(). The value differs from the size returned in allocation() in that functions like set_halign() can adjust the allocation, but not the value returned by this function.

If a widget is not visible, its allocated size is 0.

Returns
allocation

a pointer to a GtkAllocation to copy to

baseline

a pointer to an integer to copy to

Returns the width that has currently been allocated to self. This function is intended to be used when implementing handlers for the signal::Widget::draw function.

Returns

the width of the self

Retrieves the widget’s allocation.

Note, when implementing a Container: a widget’s allocation will be its “adjusted” allocation, that is, the widget’s parent container typically calls size_allocate() with an allocation, and that allocation is then adjusted (to handle margin and alignment for example) before assignment to the widget. allocation() returns the adjusted allocation that was actually assigned to the widget. The adjusted allocation is guaranteed to be completely contained within the size_allocate() allocation, however. So a Container is guaranteed that its children stay inside the assigned bounds, but not that they have exactly the bounds the container assigned. There is no way to get the original allocation assigned by size_allocate(), since it isn’t stored; if a container implementation needs that information it will have to track it itself.

Returns
allocation

a pointer to a GtkAllocation to copy to

Gets the first ancestor of self with type widget_type. For example, gtk_widget_get_ancestor (widget, GTK_TYPE_BOX) gets the first Box that’s an ancestor of self. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevel Window in the docs for toplevel().

Note that unlike is_ancestor(), ancestor() considers self to be an ancestor of itself.

widget_type

ancestor type

Returns

the ancestor widget, or None if not found

Determines whether the application intends to draw on the widget in an signal::Widget::draw handler.

See set_app_paintable()

Returns

true if the widget is app paintable

Determines whether self can be a default widget. See set_can_default().

Returns

true if self can be a default widget, false otherwise

Determines whether self can own the input focus. See set_can_focus().

Returns

true if self can own the input focus, false otherwise

Gets the value set with set_child_visible(). If you feel a need to use this function, your code probably needs reorganization.

This function is only useful for container implementations and never should be called by an application.

Returns

true if the widget is mapped with the parent.

Retrieves the widget’s clip area.

The clip area is the area in which all of self’s drawing will happen. Other toolkits call it the bounding box.

Historically, in GTK+ the clip area has been equal to the allocation retrieved via allocation().

Returns
clip

a pointer to a GtkAllocation to copy to

Returns the clipboard object for the given selection to be used with self. self must have a gdk::Display associated with it, so must be attached to a toplevel window.

selection

a gdk::Atom which identifies the clipboard to use. GDK_SELECTION_CLIPBOARD gives the default clipboard. Another common value is GDK_SELECTION_PRIMARY, which gives the primary X selection.

Returns

the appropriate clipboard object. If no clipboard already exists, a new one will be created. Once a clipboard object has been created, it is persistent for all time.

Returns whether device can interact with self and its children. See set_device_enabled().

device

a gdk::Device

Returns

true is device is enabled for self

Returns the events mask for the widget corresponding to an specific device. These are the events that the widget will receive when device operates on it.

device

a gdk::Device

Returns

device event mask for self

Gets the reading direction for a particular widget. See set_direction().

Returns

the reading direction for the widget.

Get the gdk::Display for the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top.

In general, you should only create display specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

Returns

the gdk::Display for the toplevel for this widget.

Determines whether the widget is double buffered.

See gtk_widget_set_double_buffered()

Returns

true if the widget is double buffered

Available on crate feature v3_20 only.

Returns whether the widget should grab focus when it is clicked with the mouse. See set_focus_on_click().

Returns

true if the widget should grab focus when it is clicked with the mouse.

Gets the font map that has been set with set_font_map().

Returns

A pango::FontMap, or None

Returns the cairo::FontOptions used for Pango rendering. When not set, the defaults font options for the gdk::Screen will be used.

Returns

the cairo::FontOptions or None if not set

Obtains the frame clock for a widget. The frame clock is a global “ticker” that can be used to drive animations and repaints. The most common reason to get the frame clock is to call FrameClock::frame_time(), in order to get a time to use for animating. For example you might record the start of the animation with an initial value from FrameClock::frame_time(), and then update the animation by calling FrameClock::frame_time() again during each repaint.

FrameClock::request_phase() will result in a new frame on the clock, but won’t necessarily repaint any widgets. To repaint a widget, you have to use queue_draw() which invalidates the widget (thus scheduling it to receive a draw on the next frame). queue_draw() will also end up requesting a frame on the appropriate frame clock.

A widget’s frame clock will not change while the widget is mapped. Reparenting a widget (which implies a temporary unmap) can change the widget’s frame clock.

Unrealized widgets do not have a frame clock.

Returns

a gdk::FrameClock, or None if widget is unrealized

Gets the value of the property::Widget::halign property.

For backwards compatibility reasons this method will never return Align::Baseline, but instead it will convert it to Align::Fill. Baselines are not supported for horizontal alignment.

Returns

the horizontal alignment of self

Returns the current value of the has-tooltip property. See property::Widget::has-tooltip for more information.

Returns

current value of has-tooltip on self.

Determines whether self has a gdk::Window of its own. See set_has_window().

Returns

true if self has a window, false otherwise

Gets whether the widget would like any available extra horizontal space. When a user resizes a Window, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

Containers should use compute_expand() rather than this function, to see whether a widget, or any of its children, has the expand flag set. If any child of a widget wants to expand, the parent may ask to expand also.

This function only looks at the widget’s own hexpand flag, rather than computing whether the entire widget tree rooted at this widget wants to expand.

Returns

whether hexpand flag is set

Gets whether set_hexpand() has been used to explicitly set the expand flag on this widget.

If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

There are few reasons to use this function, but it’s here for completeness and consistency.

Returns

whether hexpand has been explicitly set

Whether the widget is mapped.

Returns

true if the widget is mapped, false otherwise.

Gets the value of the property::Widget::margin-bottom property.

Returns

The bottom margin of self

Gets the value of the property::Widget::margin-end property.

Returns

The end margin of self

Gets the value of the property::Widget::margin-start property.

Returns

The start margin of self

Gets the value of the property::Widget::margin-top property.

Returns

The top margin of self

Returns the modifier mask the self’s windowing system backend uses for a particular purpose.

See gdk_keymap_get_modifier_mask().

intent

the use case for the modifier mask

Returns

the modifier mask used for intent.

Retrieves the name of a widget. See set_widget_name() for the significance of widget names.

Returns

name of the widget. This string is owned by GTK+ and should not be modified or freed

Returns the current value of the property::Widget::no-show-all property, which determines whether calls to show_all() will affect this widget.

Returns

the current value of the “no-show-all” property.

Fetches the requested opacity for this widget. See set_opacity().

Returns

the requested opacity for this widget.

Gets a pango::Context with the appropriate font map, font description, and base direction for this widget. Unlike the context returned by create_pango_context(), this context is owned by the widget (it can be used until the screen for the widget changes or the widget is removed from its toplevel), and will be updated to match any changes to the widget’s attributes. This can be tracked by using the signal::Widget::screen-changed signal on the widget.

Returns

the pango::Context for the widget.

Returns the parent container of self.

Returns

the parent container of self, or None

Gets self’s parent window, or None if it does not have one.

Returns

the parent window of self, or None if it does not have a parent window.

Returns the WidgetPath representing self, if the widget is not connected to a toplevel widget, a partial path will be created.

Returns

The WidgetPath representing self

Retrieves a widget’s initial minimum and natural height.

This call is specific to width-for-height requests.

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Returns
minimum_height

location to store the minimum height, or None

natural_height

location to store the natural height, or None

Retrieves a widget’s minimum and natural height and the corresponding baselines if it would be given the specified width, or the default height if width is -1. The baselines may be -1 which means that no baseline is requested for this widget.

The returned request will be modified by the GtkWidgetClass::adjust_size_request and GtkWidgetClass::adjust_baseline_request virtual methods and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

width

the width which is available for allocation, or -1 if none

Returns
minimum_height

location for storing the minimum height, or None

natural_height

location for storing the natural height, or None

minimum_baseline

location for storing the baseline for the minimum height, or None

natural_baseline

location for storing the baseline for the natural height, or None

Retrieves a widget’s minimum and natural height if it would be given the specified width.

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

width

the width which is available for allocation

Returns
minimum_height

location for storing the minimum height, or None

natural_height

location for storing the natural height, or None

Retrieves the minimum and natural size of a widget, taking into account the widget’s preference for height-for-width management.

This is used to retrieve a suitable size by container widgets which do not impose any restrictions on the child placement. It can be used to deduce toplevel window and menu sizes as well as child widgets in free-form containers such as GtkLayout.

Handle with care. Note that the natural height of a height-for-width widget will generally be a smaller size than the minimum height, since the required height for the natural width is generally smaller than the required height for the minimum width.

Use preferred_height_and_baseline_for_width() if you want to support baseline alignment.

Returns
minimum_size

location for storing the minimum size, or None

natural_size

location for storing the natural size, or None

Retrieves a widget’s initial minimum and natural width.

This call is specific to height-for-width requests.

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

Returns
minimum_width

location to store the minimum width, or None

natural_width

location to store the natural width, or None

Retrieves a widget’s minimum and natural width if it would be given the specified height.

The returned request will be modified by the GtkWidgetClass::adjust_size_request virtual method and by any GtkSizeGroups that have been applied. That is, the returned request is the one that should be used for layout, not necessarily the one returned by the widget itself.

height

the height which is available for allocation

Returns
minimum_width

location for storing the minimum width, or None

natural_width

location for storing the natural width, or None

Determines whether self is realized.

Returns

true if self is realized, false otherwise

Determines whether self is always treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

See set_receives_default().

Returns

true if self acts as the default widget when focused, false otherwise

Gets whether the widget prefers a height-for-width layout or a width-for-height layout.

Bin widgets generally propagate the preference of their child, container widgets need to request something either in context of their children or in context of their allocation capabilities.

Returns

The SizeRequestMode preferred by self.

Retrieves the internal scale factor that maps from window coordinates to the actual device pixels. On traditional systems this is 1, on high density outputs, it can be a higher value (typically 2).

See Window::scale_factor().

Returns

the scale factor for self

Get the gdk::Screen from the toplevel window associated with this widget. This function can only be called after the widget has been added to a widget hierarchy with a Window at the top.

In general, you should only create screen specific resources when a widget has been realized, and you should free those resources when the widget is unrealized.

Returns

the gdk::Screen for the toplevel for this widget.

Returns the widget’s sensitivity (in the sense of returning the value that has been set using set_sensitive()).

The effective sensitivity of a widget is however determined by both its own and its parent widget’s sensitivity. See is_sensitive().

Returns

true if the widget is sensitive

Gets the settings object holding the settings used for this widget.

Note that this function can only be called when the Widget is attached to a toplevel, since the settings object is specific to a particular gdk::Screen.

Returns

the relevant Settings object

Gets the size request that was explicitly set for the widget using set_size_request(). A value of -1 stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used instead. See set_size_request(). To get the size a widget will actually request, call preferred_size() instead of this function.

Returns
width

return location for width, or None

height

return location for height, or None

Returns the widget state as a flag set. It is worth mentioning that the effective StateFlags::INSENSITIVE state will be returned, that is, also based on parent insensitivity, even if self itself is sensitive.

Also note that if you are looking for a way to obtain the StateFlags to pass to a StyleContext method, you should look at StyleContextExt::state().

Returns

The state flags for widget

Returns the style context associated to self. The returned object is guaranteed to be the same for the lifetime of self.

Returns

a StyleContext. This memory is owned by self and must not be freed.

Returns true if self is multiple pointer aware. See set_support_multidevice() for more information.

Returns

true if self is multidevice aware.

Fetch an object build from the template XML for widget_type in this self instance.

This will only report children which were previously declared with gtk_widget_class_bind_template_child_full() or one of its variants.

This function is only meant to be called for code which is private to the widget_type which declared the child and is meant for language bindings which cannot easily make use of the GObject structure offsets.

widget_type

The GType to get a template child for

name

The “id” of the child defined in the template XML

Returns

The object built in the template XML with the id name

Gets the contents of the tooltip for self.

Returns

the tooltip text, or None. You should free the returned string with g_free() when done.

Gets the contents of the tooltip for self.

Returns

the tooltip text, or None. You should free the returned string with g_free() when done.

Returns the Window of the current tooltip. This can be the GtkWindow created by default, or the custom tooltip window set using set_tooltip_window().

Returns

The Window of the current tooltip.

This function returns the topmost widget in the container hierarchy self is a part of. If self has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced.

Note the difference in behavior vs. ancestor(); gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW) would return None if self wasn’t inside a toplevel window, and if the window was inside a Window-derived widget which was in turn inside the toplevel Window. While the second case may seem unlikely, it actually happens when a Plug is embedded inside a Socket within the same application.

To reliably find the toplevel Window, use toplevel() and call GTK_IS_WINDOW() on the result. For instance, to get the title of a widget’s toplevel window, one might use:

⚠️ The following code is in C ⚠️

static const char *
get_widget_toplevel_title (GtkWidget *widget)
{
  GtkWidget *toplevel = gtk_widget_get_toplevel (widget);
  if (GTK_IS_WINDOW (toplevel))
    {
      return gtk_window_get_title (GTK_WINDOW (toplevel));
    }

  return NULL;
}
Returns

the topmost ancestor of self, or self itself if there’s no ancestor.

Gets the value of the property::Widget::valign property.

For backwards compatibility reasons this method will never return Align::Baseline, but instead it will convert it to Align::Fill. If your widget want to support baseline aligned children it must use valign_with_baseline(), or g_object_get (widget, "valign", &value, NULL), which will also report the true value.

Returns

the vertical alignment of self, ignoring baseline alignment

Gets the value of the property::Widget::valign property, including Align::Baseline.

Returns

the vertical alignment of self

Gets whether the widget would like any available extra vertical space.

See hexpands() for more detail.

Returns

whether vexpand flag is set

Gets whether set_vexpand() has been used to explicitly set the expand flag on this widget.

See is_hexpand_set() for more detail.

Returns

whether vexpand has been explicitly set

Determines whether the widget is visible. If you want to take into account whether the widget’s parent is also marked as visible, use is_visible() instead.

This function does not check if the widget is obscured in any way.

See set_visible().

Returns

true if the widget is visible

Gets the visual that will be used to render self.

Returns

the visual for self

Returns the widget’s window if it is realized, None otherwise

Returns

self’s window.

Makes self the current grabbed widget.

This means that interaction with other widgets in the same application is blocked and mouse as well as keyboard events are delivered to this widget.

If self is not sensitive, it is not set as the current grabbed widget and this function does nothing.

Causes self to become the default widget. self must be able to be a default widget; typically you would ensure this yourself by calling set_can_default() with a true value. The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, activate() should affect them. Note that Entry widgets require the “activates-default” property set to true before they activate the default widget when Enter is pressed and the Entry is focused.

Causes self to have the keyboard focus for the Window it’s inside. self must be a focusable widget, such as a Entry; something like Frame won’t work.

More precisely, it must have the GTK_CAN_FOCUS flag set. Use set_can_focus() to modify that flag.

The widget also needs to be realized and mapped. This is indicated by the related signals. Grabbing the focus immediately after creating the widget will likely fail and cause critical warnings.

Removes the grab from the given widget.

You have to pair calls to grab_add() and grab_remove().

If self does not have the grab, this function does nothing.

Determines whether self is the current default widget within its toplevel. See set_can_default().

Returns

true if self is the current default widget within its toplevel, false otherwise

Determines if the widget has the global input focus. See is_focus() for the difference between having the global input focus, and only having the focus within a toplevel.

Returns

true if the widget has the global input focus.

Determines whether the widget is currently grabbing events, so it is the only widget receiving input events (keyboard and mouse).

See also grab_add().

Returns

true if the widget is in the grab_widgets stack

Checks whether there is a gdk::Screen is associated with this widget. All toplevel widgets have an associated screen, and all widgets added into a hierarchy with a toplevel window at the top.

Returns

true if there is a gdk::Screen associated with the widget.

Determines if the widget should show a visible indication that it has the global input focus. This is a convenience function for use in ::draw handlers that takes into account whether focus indication should currently be shown in the toplevel window of self. See GtkWindowExt::gets_focus_visible() for more information about focus indication.

To find out if the widget has the global input focus, use has_focus().

Returns

true if the widget should display a “focus rectangle”

Reverses the effects of show(), causing the widget to be hidden (invisible to the user).

Returns whether the widget is currently being destroyed. This information can sometimes be used to avoid doing unnecessary work.

Returns

true if self is being destroyed

Creates and initializes child widgets defined in templates. This function must be called in the instance initializer for any class which assigned itself a template using gtk_widget_class_set_template()

It is important to call this function in the instance initializer of a Widget subclass and not in GObject.constructed() or GObject.constructor() for two reasons.

One reason is that generally derived widgets will assume that parent class composite widgets have been created in their instance initializers.

Another reason is that when calling glib::Object::new() on a widget with composite templates, it’s important to build the composite widgets before the construct properties are set. Properties passed to glib::Object::new() should take precedence over properties set in the private template XML.

Sets an input shape for this widget’s GDK window. This allows for windows which react to mouse click in a nonrectangular region, see Window::input_shape_combine_region() for more information.

region

shape to be added, or None to remove an existing shape

Inserts group into self. Children of self that implement Actionable can then be associated with actions in group by setting their “action-name” to prefix.action-name.

If group is None, a previously inserted group for name is removed from self.

name

the prefix for actions in group

group

a gio::ActionGroup, or None

Determines whether self is somewhere inside ancestor, possibly with intermediate containers.

ancestor

another Widget

Returns

true if ancestor contains self as a child, grandchild, great grandchild, etc.

Whether self can rely on having its alpha channel drawn correctly. On X11 this function returns whether a compositing manager is running for self’s screen.

Please note that the semantics of this call will change in the future if used on a widget that has a composited window in its hierarchy (as set by gdk_window_set_composited()).

Deprecated since 3.22

Use Screen::is_composited() instead.

Returns

true if the widget can rely on its alpha channel being drawn correctly.

Determines whether self can be drawn to. A widget can be drawn to if it is mapped and visible.

Returns

true if self is drawable, false otherwise

Determines if the widget is the focus widget within its toplevel. (This does not mean that the property::Widget::has-focus property is necessarily set; property::Widget::has-focus will only be set if the toplevel widget additionally has the global input focus.)

Returns

true if the widget is the focus widget.

Returns the widget’s effective sensitivity, which means it is sensitive itself and also its parent widget is sensitive

Returns

true if the widget is effectively sensitive

Determines whether self is a toplevel widget.

Currently only Window and Invisible (and out-of-process GtkPlugs) are toplevel widgets. Toplevel widgets have no parent widget.

Returns

true if self is a toplevel, false otherwise

Determines whether the widget and all its parents are marked as visible.

This function does not check if the widget is obscured in any way.

See also get_visible() and set_visible()

Returns

true if the widget and all its parents are visible

This function should be called whenever keyboard navigation within a single widget hits a boundary. The function emits the signal::Widget::keynav-failed signal on the widget and its return value should be interpreted in a way similar to the return value of child_focus():

When true is returned, stay in the widget, the failed keyboard navigation is OK and/or there is nowhere we can/should move the focus to.

When false is returned, the caller should continue with keyboard navigation outside the widget, e.g. by calling child_focus() on the widget’s toplevel.

The default ::keynav-failed handler returns false for DirectionType::TabForward and DirectionType::TabBackward. For the other values of DirectionType it returns true.

Whenever the default handler returns true, it also calls error_bell() to notify the user of the failed keyboard navigation.

A use case for providing an own implementation of ::keynav-failed (either by connecting to it or by overriding it) would be a row of Entry widgets where the user should be able to navigate the entire row with the cursor keys, as e.g. known from user interfaces that require entering license keys.

direction

direction of focus movement

Returns

true if stopping keyboard navigation is fine, false if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).

Lists the closures used by self for accelerator group connections with AccelGroupExtManual::connect_accel_group_by_path() or AccelGroupExtManual::connect_accel_group(). The closures can be used to monitor accelerator changes on self, by connecting to the AccelGroup signal of the AccelGroup of a closure which can be found out with AccelGroup::from_accel_closure().

Returns

a newly allocated GList of closures

Retrieves a None-terminated array of strings containing the prefixes of gio::ActionGroup’s available to self.

Returns

a None-terminated array of strings.

Returns a newly allocated list of the widgets, normally labels, for which this widget is the target of a mnemonic (see for example, LabelExt::set_mnemonic_widget()).

The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call g_list_foreach (result, (GFunc)g_object_ref, NULL) first, and then unref all the widgets afterwards.

Returns

the list of mnemonic labels; free this list with g_list_free() when you are done with it.

This function is only for use in widget implementations. Causes a widget to be mapped if it isn’t already.

Emits the signal::Widget::mnemonic-activate signal.

group_cycling

true if there are other widgets with the same mnemonic

Returns

true if the signal has been handled

Available on crate feature v3_20 only.

This function is only for use in widget implementations.

Flags the widget for a rerun of the GtkWidgetClass::size_allocate function. Use this function instead of queue_resize() when the self’s size request didn’t change but it wants to reposition its contents.

An example user of this function is set_halign().

Mark self as needing to recompute its expand flags. Call this function when setting legacy expand child properties on the child of a container.

See compute_expand().

Equivalent to calling queue_draw_area() for the entire area of a widget.

Convenience function that calls queue_draw_region() on the region created from the given coordinates.

The region here is specified in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as self->window coordinates for widgets that return true for has_window(), and are relative to self->allocation.x, self->allocation.y otherwise.

width or height may be 0, in this case this function does nothing. Negative values for width and height are not allowed.

x

x coordinate of upper-left corner of rectangle to redraw

y

y coordinate of upper-left corner of rectangle to redraw

width

width of region to draw

height

height of region to draw

Invalidates the area of self defined by region by calling Window::invalidate_region() on the widget’s window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated.

Normally you would only use this function in widget implementations. You might also use it to schedule a redraw of a DrawingArea or some portion thereof.

region

region to draw

This function is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a Label, Label queues a resize to ensure there’s enough space for the new text.

Note that you cannot call queue_resize() on a widget from inside its implementation of the GtkWidgetClass::size_allocate virtual method. Calls to queue_resize() from inside GtkWidgetClass::size_allocate will be silently ignored.

This function works like queue_resize(), except that the widget is not invalidated.

Creates the GDK (windowing system) resources associated with a widget. For example, self->window will be created when a widget is realized. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically.

Realizing a widget requires all the widget’s parent widgets to be realized; calling realize() realizes the widget’s parents in addition to self itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen.

This function is primarily used in widget implementations, and isn’t very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as signal::Widget::draw. Or simply g_signal_connect () to the signal::Widget::realize signal.

Registers a gdk::Window with the widget and sets it up so that the widget receives events for it. Call unregister_window() when destroying the window.

Before 3.8 you needed to call [Window::set_user_data()][crate::gdk::Window::set_user_data()] directly to set this up. This is now deprecated and you should use register_window() instead. Old code will keep working as is, although some new features like transparency might not work perfectly.

window

a gdk::Window

Removes an accelerator from self, previously installed with add_accelerator().

accel_group

accel group for this widget

accel_key

GDK keyval of the accelerator

accel_mods

modifier key combination of the accelerator

Returns

whether an accelerator was installed and could be removed

Removes a widget from the list of mnemonic labels for this widget. (See list_mnemonic_labels()). The widget must have previously been added to the list with add_mnemonic_label().

label

a Widget that was previously set as a mnemonic label for self with add_mnemonic_label().

Updates the style context of self and all descendants by updating its widget path. GtkContainers may want to use this on a child when reordering it in a way that a different style might apply to it. See also ContainerExt::path_for_child().

Very rarely-used function. This function is used to emit an expose event on a widget. This function is not normally used directly. The only time it is used is when propagating an expose event to a windowless child widget (has_window() is false), and that is normally done using ContainerExt::propagate_draw().

If you want to force an area of a window to be redrawn, use Window::invalidate_rect() or Window::invalidate_region(). To cause the redraw to be done immediately, follow that call with a call to Window::process_updates().

Deprecated since 3.22

Application and widget code should not handle expose events directly; invalidation should use the Widget API, and drawing should only happen inside signal::Widget::draw implementations

event

a expose GdkEvent

Returns

return from the event signal emission (true if the event was handled)

Sends the focus change event to self

This function is not meant to be used by applications. The only time it should be used is when it is necessary for a Widget to assign focus to a widget that is semantically owned by the first widget even though it’s not a direct child - for instance, a search entry in a floating window similar to the quick search in TreeView.

An example of its usage is:

⚠️ The following code is in C ⚠️

  GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);

  fevent->focus_change.type = GDK_FOCUS_CHANGE;
  fevent->focus_change.in = TRUE;
  fevent->focus_change.window = _gtk_widget_get_window (widget);
  if (fevent->focus_change.window != NULL)
    g_object_ref (fevent->focus_change.window);

  gtk_widget_send_focus_change (widget, fevent);

  gdk_event_free (event);
event

a GdkEvent of type GDK_FOCUS_CHANGE

Returns

the return value from the event signal emission: true if the event was handled, and false otherwise

Given an accelerator group, accel_group, and an accelerator path, accel_path, sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, self will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to set_accel_path(). Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See gtk_accel_map_save().)

This function is a low level function that would most likely be used by a menu creation system like GtkUIManager. If you use GtkUIManager, setting up accelerator paths will be done automatically.

Even when you you aren’t using GtkUIManager, if you only want to set up accelerators on menu items GtkMenuItemExt::set_accel_path() provides a somewhat more convenient interface.

Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().

accel_path

path used to look up the accelerator

accel_group

a AccelGroup.

Sets the widget’s allocation. This should not be used directly, but from within a widget’s size_allocate method.

The allocation set should be the “adjusted” or actual allocation. If you’re implementing a Container, you want to use size_allocate() instead of set_allocation(). The GtkWidgetClass::adjust_size_allocation virtual method adjusts the allocation inside size_allocate() to create an adjusted allocation.

allocation

a pointer to a GtkAllocation to copy from

Sets whether the application intends to draw on the widget in an signal::Widget::draw handler.

This is a hint to the widget and does not affect the behavior of the GTK+ core; many widgets ignore this flag entirely. For widgets that do pay attention to the flag, such as EventBox and Window, the effect is to suppress default themed drawing of the widget’s background. (Children of the widget will still be drawn.) The application is then entirely responsible for drawing the widget background.

Note that the background is still drawn when the widget is mapped.

app_paintable

true if the application will paint on the widget

Specifies whether self can be a default widget. See grab_default() for details about the meaning of “default”.

can_default

whether or not self can be a default widget.

Specifies whether self can own the input focus. See grab_focus() for actually setting the input focus on a widget.

can_focus

whether or not self can own the input focus.

Sets whether self should be mapped along with its when its parent is mapped and self has been shown with show().

The child visibility can be set for widget before it is added to a container with set_parent(), to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of true when the widget is removed from a container.

Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself.

This function is only useful for container implementations and never should be called by an application.

is_visible

if true, self should be mapped along with its parent.

Sets the widget’s clip. This must not be used directly, but from within a widget’s size_allocate method. It must be called after set_allocation() (or after chaining up to the parent class), because that function resets the clip.

The clip set should be the area that self draws on. If self is a Container, the area must contain all children’s clips.

If this function is not called by self during a ::size-allocate handler, the clip will be set to self’s allocation.

clip

a pointer to a GtkAllocation to copy from

Enables or disables a gdk::Device to interact with self and all its children.

It does so by descending through the gdk::Window hierarchy and enabling the same mask that is has for core events (i.e. the one that Window::events() returns).

device

a gdk::Device

enabled

whether to enable the device

Sets the device event mask (see gdk::EventMask) for a widget. The event mask determines which events a widget will receive from device. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget’s functionality, so be careful. This function must be called while a widget is unrealized. Consider add_device_events() for widgets that are already realized, or if you want to preserve the existing event mask. This function can’t be used with windowless widgets (which return false from has_window()); to get events on those widgets, place them inside a EventBox and receive events on the event box.

device

a gdk::Device

events

event mask

Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitly visual rather than logical (such as buttons for text justification).

If the direction is set to TextDirection::None, then the value set by Widget::set_default_direction() will be used.

dir

the new direction

Available on crate feature v3_20 only.

Sets whether the widget should grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

focus_on_click

whether the widget should grab focus when clicked with the mouse

Sets the font map to use for Pango rendering. When not set, the widget will inherit the font map from its parent.

font_map

a pango::FontMap, or None to unset any previously set font map

Sets the cairo::FontOptions used for Pango rendering in this widget. When not set, the default font options for the gdk::Screen will be used.

options

a cairo::FontOptions, or None to unset any previously set default font options.

Sets the horizontal alignment of self. See the property::Widget::halign property.

align

the horizontal alignment

Sets the has-tooltip property on self to has_tooltip. See property::Widget::has-tooltip for more information.

has_tooltip

whether or not self has a tooltip.

Specifies whether self has a gdk::Window of its own. Note that all realized widgets have a non-None “window” pointer (window() never returns a None window when a widget is realized), but for many of them it’s actually the gdk::Window of one of its parent widgets. Widgets that do not create a window for themselves in signal::Widget::realize must announce this by calling this function with has_window = false.

This function should only be called by widget implementations, and they should call it in their init() function.

has_window

whether or not self has a window.

Sets whether the widget would like any available extra horizontal space. When a user resizes a Window, widgets with expand=TRUE generally receive the extra space. For example, a list or scrollable area or document in your window would often be set to expand.

Call this function to set the expand flag if you would like your widget to become larger horizontally when the window has extra room.

By default, widgets automatically expand if any of their children want to expand. (To see if a widget will automatically expand given its current children and state, call compute_expand(). A container can decide how the expandability of children affects the expansion of the container by overriding the compute_expand virtual method on Widget.).

Setting hexpand explicitly with this function will override the automatic expand behavior.

This function forces the widget to expand or not to expand, regardless of children. The override occurs because set_hexpand() sets the hexpand-set property (see set_hexpand_set()) which causes the widget’s hexpand value to be used, rather than looking at children and widget state.

expand

whether to expand

Sets whether the hexpand flag (see hexpands()) will be used.

The hexpand-set property will be set automatically when you call set_hexpand() to set hexpand, so the most likely reason to use this function would be to unset an explicit expand flag.

If hexpand is set, then it overrides any computed expand value based on child widgets. If hexpand is not set, then the expand value depends on whether any children of the widget would like to expand.

There are few reasons to use this function, but it’s here for completeness and consistency.

set

value for hexpand-set property

Marks the widget as being mapped.

This function should only ever be called in a derived widget’s “map” or “unmap” implementation.

mapped

true to mark the widget as mapped

Sets the bottom margin of self. See the property::Widget::margin-bottom property.

margin

the bottom margin

Sets the end margin of self. See the property::Widget::margin-end property.

margin

the end margin

Sets the start margin of self. See the property::Widget::margin-start property.

margin

the start margin

Sets the top margin of self. See the property::Widget::margin-top property.

margin

the top margin

Widgets can be named, which allows you to refer to them from a CSS file. You can apply a style to widgets with a particular name in the CSS file. See the documentation for the CSS syntax (on the same page as the docs for StyleContext).

Note that the CSS syntax has certain special characters to delimit and represent elements in a selector (period, #, >, *…), so using these will make your widget impossible to match by name. Any combination of alphanumeric symbols, dashes and underscores will suffice.

name

name for the widget

Sets the property::Widget::no-show-all property, which determines whether calls to show_all() will affect this widget.

This is mostly for use in constructing widget hierarchies with externally controlled visibility, see GtkUIManager.

no_show_all

the new value for the “no-show-all” property

Request the self to be rendered partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Opacity values are clamped to the [0,1] range.). This works on both toplevel widget, and child widgets, although there are some limitations:

For toplevel widgets this depends on the capabilities of the windowing system. On X11 this has any effect only on X screens with a compositing manager running. See is_composited(). On Windows it should work always, although setting a window’s opacity after the window has been shown causes it to flicker once on Windows.

For child widgets it doesn’t work if any affected widget has a native window, or disables double buffering.

opacity

desired opacity, between 0 and 1

This function is useful only when implementing subclasses of Container. Sets the container as the parent of self, and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function is unparent().

parent

parent container

Sets a non default parent window for self.

For Window classes, setting a parent_window effects whether the window is a toplevel window or can be embedded into other widgets.

For Window classes, this needs to be called before the window is realized.

parent_window

the new parent window.

Marks the widget as being realized. This function must only be called after all GdkWindows for the self have been created and registered.

This function should only ever be called in a derived widget’s “realize” or “unrealize” implementation.

realized

true to mark the widget as realized

Specifies whether self will be treated as the default widget within its toplevel when it has the focus, even if another widget is the default.

See grab_default() for details about the meaning of “default”.

receives_default

whether or not self can be a default widget.

Sets whether the entire widget is queued for drawing when its size allocation changes. By default, this setting is true and the entire widget is redrawn on every size change. If your widget leaves the upper left unchanged when made bigger, turning this setting off will improve performance.

Note that for widgets where has_window() is false setting this flag to false turns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don’t draw anything to avoid excess invalidations. If you set this flag on a widget with no window that does draw on self->window, you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size.

redraw_on_allocate

if true, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.

Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are “grayed out” and the user can’t interact with them. Insensitive widgets are known as “inactive”, “disabled”, or “ghosted” in some other toolkits.

sensitive

true to make the widget sensitive

Sets the minimum size of a widget; that is, the widget’s size request will be at least width by height. You can use this function to force a widget to be larger than it normally would be.

In most cases, GtkWindowExt::set_default_size() is a better choice for toplevel windows than this function; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, GtkWindowExt::set_geometry_hints() can be a useful function as well.

Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it’s basically impossible to hardcode a size that will always be correct.

The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested.

If the size request in a given direction is -1 (unset), then the “natural” size request of the widget will be used instead.

The size request set here does not include any margin from the Widget properties margin-left, margin-right, margin-top, and margin-bottom, but it does include pretty much all other padding or border properties set by any subclass of Widget.

width

width self should request, or -1 to unset

height

height self should request, or -1 to unset

This function is for use in widget implementations. Turns on flag values in the current widget state (insensitive, prelighted, etc.).

This function accepts the values StateFlags::DIR_LTR and StateFlags::DIR_RTL but ignores them. If you want to set the widget’s direction, use set_direction().

It is worth mentioning that any other state than StateFlags::INSENSITIVE, will be propagated down to all non-internal children if self is a Container, while StateFlags::INSENSITIVE itself will be propagated down to all Container children by different means than turning on the state flag down the hierarchy, both state_flags() and is_sensitive() will make use of these.

flags

State flags to turn on

clear

Whether to clear state before turning on flags

Enables or disables multiple pointer awareness. If this setting is true, self will start receiving multiple, per device enter/leave events. Note that if custom GdkWindows are created in signal::Widget::realize, Window::set_support_multidevice() will have to be called manually on them.

support_multidevice

true to support input from multiple devices.

Sets markup as the contents of the tooltip, which is marked up with the [Pango text markup language][PangoMarkupFormat].

This function will take care of setting property::Widget::has-tooltip to true and of the default handler for the signal::Widget::query-tooltip signal.

See also the property::Widget::tooltip-markup property and Tooltip::set_markup().

markup

the contents of the tooltip for self, or None

Sets text as the contents of the tooltip. This function will take care of setting property::Widget::has-tooltip to true and of the default handler for the signal::Widget::query-tooltip signal.

See also the property::Widget::tooltip-text property and Tooltip::set_text().

text

the contents of the tooltip for self

Replaces the default window used for displaying tooltips with custom_window. GTK+ will take care of showing and hiding custom_window at the right moment, to behave likewise as the default tooltip window. If custom_window is None, the default tooltip window will be used.

custom_window

a Window, or None

Sets the vertical alignment of self. See the property::Widget::valign property.

align

the vertical alignment

Sets whether the widget would like any available extra vertical space.

See set_hexpand() for more detail.

expand

whether to expand

Sets whether the vexpand flag (see vexpands()) will be used.

See set_hexpand_set() for more detail.

set

value for vexpand-set property

Sets the visibility state of self. Note that setting this to true doesn’t mean the widget is actually viewable, see get_visible().

This function simply calls show() or hide() but is nicer to use when the visibility of the widget depends on some condition.

visible

whether the widget should be shown or not

Sets the visual that should be used for by widget and its children for creating GdkWindows. The visual must be on the same gdk::Screen as returned by screen(), so handling the signal::Widget::screen-changed signal is necessary.

Setting a new visual will not cause self to recreate its windows, so you should call this function before self is realized.

visual

visual to be used or None to unset a previous one

Sets a widget’s window. This function should only be used in a widget’s signal::Widget::realize implementation. The window passed is usually either new window created with gdk::Window::new(), or the window of its parent widget as returned by parent_window().

Widgets must indicate whether they will create their own gdk::Window by calling set_has_window(). This is usually done in the widget’s init() function.

Note that this function does not add any reference to window.

window

a gdk::Window

Sets a shape for this widget’s GDK window. This allows for transparent windows etc., see Window::shape_combine_region() for more information.

region

shape to be added, or None to remove an existing shape

Flags a widget to be displayed. Any widget that isn’t shown will not appear on the screen. If you want to show all the widgets in a container, it’s easier to call show_all() on the container, instead of individually showing the widgets.

Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen.

When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.

Recursively shows a widget, and any child widgets (if the widget is a container).

Shows a widget. If the widget is an unmapped toplevel widget (i.e. a Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this function.

This function is only used by Container subclasses, to assign a size and position to their child widgets.

In this function, the allocation may be adjusted. It will be forced to a 1x1 minimum size, and the adjust_size_allocation virtual method on the child will be used to adjust the allocation. Standard adjustments include removing the widget’s margins, and applying the widget’s property::Widget::halign and property::Widget::valign properties.

For baseline support in containers you need to use size_allocate_with_baseline() instead.

allocation

position and size to be allocated to self

This function is only used by Container subclasses, to assign a size, position and (optionally) baseline to their child widgets.

In this function, the allocation and baseline may be adjusted. It will be forced to a 1x1 minimum size, and the adjust_size_allocation virtual and adjust_baseline_allocation methods on the child will be used to adjust the allocation and baseline. Standard adjustments include removing the widget’s margins, and applying the widget’s property::Widget::halign and property::Widget::valign properties.

If the child widget does not have a valign of Align::Baseline the baseline argument is ignored and -1 is used instead.

allocation

position and size to be allocated to self

baseline

The baseline of the child, or -1

Gets the value of a style property of self.

property_name

the name of a style property

Returns
value

location to return the property value

Reverts the effect of a previous call to freeze_child_notify(). This causes all queued signal::Widget::child-notify signals on self to be emitted.

Translate coordinates relative to self’s allocation to coordinates relative to dest_widget’s allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel.

dest_widget

a Widget

src_x

X position relative to self

src_y

Y position relative to self

Returns

false if either widget was not realized, or there was no common ancestor. In this case, nothing is stored in *dest_x and *dest_y. Otherwise true.

dest_x

location to store X position relative to dest_widget

dest_y

location to store Y position relative to dest_widget

Triggers a tooltip query on the display where the toplevel of self is located. See Tooltip::trigger_tooltip_query() for more information.

This function is only for use in widget implementations. Causes a widget to be unmapped if it’s currently mapped.

This function is only for use in widget implementations. Should be called by implementations of the remove method on Container, to dissociate a child from the container.

This function is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as self->window).

Unregisters a gdk::Window from the widget that was previously set up with register_window(). You need to call this when the window is no longer used by the widget, such as when you destroy it.

window

a gdk::Window

This function is for use in widget implementations. Turns off flag values for the current widget state (insensitive, prelighted, etc.). See set_state_flags().

flags

State flags to turn off

Whether to expand in both directions. Setting this sets both property::Widget::hexpand and property::Widget::vexpand

Whether to expand in both directions. Setting this sets both property::Widget::hexpand and property::Widget::vexpand

Sets all four sides’ margin at once. If read, returns max margin on any side.

Sets all four sides’ margin at once. If read, returns max margin on any side.

The ::button-press-event signal will be emitted when a button (typically from a mouse) is pressed.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::BUTTON_PRESS_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventButton which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::button-release-event signal will be emitted when a button (typically from a mouse) is released.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::BUTTON_RELEASE_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventButton which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This signal is present to allow applications and derived widgets to override the default Widget handling for determining whether an accelerator can be activated.

signal_id

the ID of a signal installed on widget

Returns

true if the signal can be activated.

The ::child-notify signal is emitted for each [child property][child-properties] that has changed on an object. The signal’s detail holds the property name.

child_property

the glib::ParamSpec of the changed child property

The ::composited-changed signal is emitted when the composited status of widgets screen changes. See Screen::is_composited().

Deprecated since 3.22

Use GdkScreen::composited-changed instead.

The ::configure-event signal will be emitted when the size, position or stacking of the widget’s window has changed.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

event

the gdk::EventConfigure which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Emitted when a redirected window belonging to widget gets drawn into. The region/area members of the event shows what area of the redirected drawable was drawn into.

event

the gdk::EventExpose event

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::delete-event signal is emitted if a user requests that a toplevel window is closed. The default handler for this signal destroys the window. Connecting WidgetExtManual::hide_on_delete() to this signal will cause the window to be hidden instead, so that it can later be shown again without reconstructing it.

event

the event which triggered this signal

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Signals that all holders of a reference to the widget should release the reference that they hold. May result in finalization of the widget if all references are released.

This signal is not suitable for saving widget state.

The ::destroy-event signal is emitted when a gdk::Window is destroyed. You rarely get this signal, because most widgets disconnect themselves from their window before they destroy it, so no widget owns the window at destroy time.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

event

the event which triggered this signal

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::direction-changed signal is emitted when the text direction of a widget changes.

previous_direction

the previous text direction of widget

The ::drag-begin signal is emitted on the drag source when a drag is started. A typical reason to connect to this signal is to set up a custom drag icon with e.g. drag_source_set_icon_pixbuf().

Note that some widgets set up a drag icon in the default handler of this signal, so you may have to use g_signal_connect_after() to override what the default handler did.

context

the drag context

The ::drag-data-delete signal is emitted on the drag source when a drag with the action gdk::DragAction::MOVE is successfully completed. The signal handler is responsible for deleting the data that has been dropped. What “delete” means depends on the context of the drag operation.

context

the drag context

The ::drag-data-get signal is emitted on the drag source when the drop site requests the data which is dragged. It is the responsibility of the signal handler to fill data with the data in the format which is indicated by info. See SelectionData::set() and SelectionData::set_text().

context

the drag context

data

the SelectionData to be filled with the dragged data

info

the info that has been registered with the target in the TargetList

time

the timestamp at which the data was requested

The ::drag-data-received signal is emitted on the drop site when the dragged data has been received. If the data was received in order to determine whether the drop will be accepted, the handler is expected to call gdk_drag_status() and not finish the drag. If the data was received in response to a signal::Widget::drag-drop signal (and this is the last target to be received), the handler for this signal is expected to process the received data and then call gtk_drag_finish(), setting the success parameter depending on whether the data was processed successfully.

Applications must create some means to determine why the signal was emitted and therefore whether to call gdk_drag_status() or gtk_drag_finish().

The handler may inspect the selected action with DragContext::selected_action() before calling gtk_drag_finish(), e.g. to implement gdk::DragAction::ASK as shown in the following example:

⚠️ The following code is in C ⚠️

void
drag_data_received (GtkWidget          *widget,
                    GdkDragContext     *context,
                    gint                x,
                    gint                y,
                    GtkSelectionData   *data,
                    guint               info,
                    guint               time)
{
  if ((data->length >= 0) && (data->format == 8))
    {
      GdkDragAction action;

      // handle data here

      action = gdk_drag_context_get_selected_action (context);
      if (action == GDK_ACTION_ASK)
        {
          GtkWidget *dialog;
          gint response;

          dialog = gtk_message_dialog_new (NULL,
                                           GTK_DIALOG_MODAL |
                                           GTK_DIALOG_DESTROY_WITH_PARENT,
                                           GTK_MESSAGE_INFO,
                                           GTK_BUTTONS_YES_NO,
                                           "Move the data ?\n");
          response = gtk_dialog_run (GTK_DIALOG (dialog));
          gtk_widget_destroy (dialog);

          if (response == GTK_RESPONSE_YES)
            action = GDK_ACTION_MOVE;
          else
            action = GDK_ACTION_COPY;
         }

      gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
    }
  else
    gtk_drag_finish (context, FALSE, FALSE, time);
 }
context

the drag context

x

where the drop happened

y

where the drop happened

data

the received data

info

the info that has been registered with the target in the TargetList

time

the timestamp at which the data was received

The ::drag-drop signal is emitted on the drop site when the user drops the data onto the widget. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler must ensure that gtk_drag_finish() is called to let the source know that the drop is done. The call to gtk_drag_finish() can be done either directly or in a signal::Widget::drag-data-received handler which gets triggered by calling drag_get_data() to receive the data for one or more of the supported targets.

context

the drag context

x

the x coordinate of the current cursor position

y

the y coordinate of the current cursor position

time

the timestamp of the motion event

Returns

whether the cursor position is in a drop zone

The ::drag-end signal is emitted on the drag source when a drag is finished. A typical reason to connect to this signal is to undo things done in signal::Widget::drag-begin.

context

the drag context

The ::drag-failed signal is emitted on the drag source when a drag has failed. The signal handler may hook custom code to handle a failed DnD operation based on the type of error, it returns true is the failure has been already handled (not showing the default “drag operation failed” animation), otherwise it returns false.

context

the drag context

result

the result of the drag operation

Returns

true if the failed drag operation has been already handled.

The ::drag-leave signal is emitted on the drop site when the cursor leaves the widget. A typical reason to connect to this signal is to undo things done in signal::Widget::drag-motion, e.g. undo highlighting with drag_unhighlight().

Likewise, the signal::Widget::drag-leave signal is also emitted before the ::drag-drop signal, for instance to allow cleaning up of a preview item created in the signal::Widget::drag-motion signal handler.

context

the drag context

time

the timestamp of the motion event

The ::drag-motion signal is emitted on the drop site when the user moves the cursor over the widget during a drag. The signal handler must determine whether the cursor position is in a drop zone or not. If it is not in a drop zone, it returns false and no further processing is necessary. Otherwise, the handler returns true. In this case, the handler is responsible for providing the necessary information for displaying feedback to the user, by calling gdk_drag_status().

If the decision whether the drop will be accepted or rejected can’t be made based solely on the cursor position and the type of the data, the handler may inspect the dragged data by calling drag_get_data() and defer the gdk_drag_status() call to the signal::Widget::drag-data-received handler. Note that you must pass DestDefaults::DROP, DestDefaults::MOTION or DestDefaults::ALL to WidgetExtManual::drag_dest_set() when using the drag-motion signal that way.

Also note that there is no drag-enter signal. The drag receiver has to keep track of whether he has received any drag-motion signals since the last signal::Widget::drag-leave and if not, treat the drag-motion signal as an “enter” signal. Upon an “enter”, the handler will typically highlight the drop site with drag_highlight().

⚠️ The following code is in C ⚠️

static void
drag_motion (GtkWidget      *widget,
             GdkDragContext *context,
             gint            x,
             gint            y,
             guint           time)
{
  GdkAtom target;

  PrivateData *private_data = GET_PRIVATE_DATA (widget);

  if (!private_data->drag_highlight)
   {
     private_data->drag_highlight = 1;
     gtk_drag_highlight (widget);
   }

  target = gtk_drag_dest_find_target (widget, context, NULL);
  if (target == GDK_NONE)
    gdk_drag_status (context, 0, time);
  else
   {
     private_data->pending_status
        = gdk_drag_context_get_suggested_action (context);
     gtk_drag_get_data (widget, context, target, time);
   }

  return TRUE;
}

static void
drag_data_received (GtkWidget        *widget,
                    GdkDragContext   *context,
                    gint              x,
                    gint              y,
                    GtkSelectionData *selection_data,
                    guint             info,
                    guint             time)
{
  PrivateData *private_data = GET_PRIVATE_DATA (widget);

  if (private_data->suggested_action)
   {
     private_data->suggested_action = 0;

     // We are getting this data due to a request in drag_motion,
     // rather than due to a request in drag_drop, so we are just
     // supposed to call gdk_drag_status(), not actually paste in
     // the data.

     str = gtk_selection_data_get_text (selection_data);
     if (!data_is_acceptable (str))
       gdk_drag_status (context, 0, time);
     else
       gdk_drag_status (context,
                        private_data->suggested_action,
                        time);
   }
  else
   {
     // accept the drop
   }
}
context

the drag context

x

the x coordinate of the current cursor position

y

the y coordinate of the current cursor position

time

the timestamp of the motion event

Returns

whether the cursor position is in a drop zone

This signal is emitted when a widget is supposed to render itself. The widget’s top left corner must be painted at the origin of the passed in context and be sized to the values returned by allocated_width() and allocated_height().

Signal handlers connected to this signal can modify the cairo context passed as cr in any way they like and don’t need to restore it. The signal emission takes care of calling cairo_save() before and cairo_restore() after invoking the handler.

The signal handler will get a cr with a clip region already set to the widget’s dirty region, i.e. to the area that needs repainting. Complicated widgets that want to avoid redrawing themselves completely can get the full extents of the clip region with gdk_cairo_get_clip_rectangle(), or they can get a finer-grained representation of the dirty region with cairo_copy_clip_rectangle_list().

cr

the cairo context to draw to

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::enter-notify-event will be emitted when the pointer enters the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::ENTER_NOTIFY_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventCrossing which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The GTK+ main loop will emit three signals for each GDK event delivered to a widget: one generic ::event signal, another, more specific, signal that matches the type of event delivered (e.g. signal::Widget::key-press-event) and finally a generic signal::Widget::event-after signal.

event

the GdkEvent which triggered this signal

Returns

true to stop other handlers from being invoked for the event and to cancel the emission of the second specific ::event signal. false to propagate the event further and to allow the emission of the second signal. The ::event-after signal is emitted regardless of the return value.

After the emission of the signal::Widget::event signal and (optionally) the second more specific signal, ::event-after will be emitted regardless of the previous two signals handlers return values.

event

the GdkEvent which triggered this signal

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::focus-in-event signal will be emitted when the keyboard focus enters the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::FOCUS_CHANGE_MASK mask.

event

the gdk::EventFocus which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::focus-out-event signal will be emitted when the keyboard focus leaves the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::FOCUS_CHANGE_MASK mask.

event

the gdk::EventFocus which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Emitted when a pointer or keyboard grab on a window belonging to widget gets broken.

On X11, this happens when the grab window becomes unviewable (i.e. it or one of its ancestors is unmapped), or if the same application grabs the pointer or keyboard again.

event

the gdk::EventGrabBroken event

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::grab-notify signal is emitted when a widget becomes shadowed by a GTK+ grab (not a pointer or keyboard grab) on another widget, or when it becomes unshadowed due to a grab being removed.

A widget is shadowed by a grab_add() when the topmost grab widget in the grab stack of its window group is not its ancestor.

was_grabbed

false if the widget becomes shadowed, true if it becomes unshadowed

The ::hide signal is emitted when widget is hidden, for example with hide().

The ::hierarchy-changed signal is emitted when the anchored state of a widget changes. A widget is “anchored” when its toplevel ancestor is a Window. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa.

previous_toplevel

the previous toplevel ancestor, or None if the widget was previously unanchored

The ::key-press-event signal is emitted when a key is pressed. The signal emission will reoccur at the key-repeat rate when the key is kept pressed.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::KEY_PRESS_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventKey which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::key-release-event signal is emitted when a key is released.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::KEY_RELEASE_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventKey which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Gets emitted if keyboard navigation fails. See keynav_failed() for details.

direction

the direction of movement

Returns

true if stopping keyboard navigation is fine, false if the emitting widget should try to handle the keyboard navigation attempt in its parent container(s).

The ::leave-notify-event will be emitted when the pointer leaves the widget’s window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::LEAVE_NOTIFY_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventCrossing which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::map signal is emitted when widget is going to be mapped, that is when the widget is visible (which is controlled with set_visible()) and all its parents up to the toplevel widget are also visible. Once the map has occurred, signal::Widget::map-event will be emitted.

The ::map signal can be used to determine whether a widget will be drawn, for instance it can resume an animation that was stopped during the emission of signal::Widget::unmap.

The default handler for this signal activates widget if group_cycling is false, or just makes widget grab focus if group_cycling is true.

group_cycling

true if there are other widgets with the same mnemonic

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::motion-notify-event signal is emitted when the pointer moves over the widget’s gdk::Window.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::POINTER_MOTION_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventMotion which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::parent-set signal is emitted when a new parent has been set on a widget.

old_parent

the previous parent, or None if the widget just got its initial parent.

This signal gets emitted whenever a widget should pop up a context menu. This usually happens through the standard key binding mechanism; by pressing a certain key while a widget is focused, the user can cause the widget to pop up a menu. For example, the Entry widget creates a menu with clipboard commands. See the [Popup Menu Migration Checklist][checklist-popup-menu] for an example of how to use this signal.

Returns

true if a menu was activated

The ::property-notify-event signal will be emitted when a property on the widget’s window has been changed or deleted.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROPERTY_CHANGE_MASK mask.

event

the gdk::EventProperty which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROXIMITY_IN_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventProximity which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::PROXIMITY_OUT_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventProximity which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Emitted when property::Widget::has-tooltip is true and the hover timeout has expired with the cursor hovering “above” widget; or emitted when widget got focus in keyboard mode.

Using the given coordinates, the signal handler should determine whether a tooltip should be shown for widget. If this is the case true should be returned, false otherwise. Note that if keyboard_mode is true, the values of x and y are undefined and should not be used.

The signal handler is free to manipulate tooltip with the therefore destined function calls.

x

the x coordinate of the cursor position where the request has been emitted, relative to widget’s left side

y

the y coordinate of the cursor position where the request has been emitted, relative to widget’s top

keyboard_mode

true if the tooltip was triggered using the keyboard

tooltip

a Tooltip

Returns

true if tooltip should be shown right now, false otherwise.

The ::realize signal is emitted when widget is associated with a gdk::Window, which means that realize() has been called or the widget has been mapped (that is, it is going to be drawn).

The ::screen-changed signal gets emitted when the screen of a widget has changed.

previous_screen

the previous screen, or None if the widget was not associated with a screen before

The ::scroll-event signal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.

To receive this signal, the gdk::Window associated to the widget needs to enable the gdk::EventMask::SCROLL_MASK mask.

This signal will be sent to the grab widget if there is one.

event

the gdk::EventScroll which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::selection-clear-event signal will be emitted when the the widget’s window has lost ownership of a selection.

event

the gdk::EventSelection which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::selection-request-event signal will be emitted when another client requests ownership of the selection owned by the widget’s window.

event

the gdk::EventSelection which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

The ::show signal is emitted when widget is shown, for example with show().

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

allocation

the region which has been allocated to the widget.

The ::state-flags-changed signal is emitted when the widget state changes, see state_flags().

flags

The previous state flags.

The ::style-updated signal is a convenience signal that is emitted when the signal::StyleContext::changed signal is emitted on the widget’s associated StyleContext as returned by style_context().

Note that style-modifying functions like gtk_widget_override_color() also cause this signal to be emitted.

The ::unmap signal is emitted when widget is going to be unmapped, which means that either it or any of its parents up to the toplevel widget have been set as hidden.

As ::unmap indicates that a widget will not be shown any longer, it can be used to, for example, stop an animation on the widget.

The ::unrealize signal is emitted when the gdk::Window associated with widget is destroyed, which means that unrealize() has been called or the widget has been unmapped (that is, it is going to be hidden).

The ::window-state-event will be emitted when the state of the toplevel window associated to the widget changes.

To receive this signal the gdk::Window associated to the widget needs to enable the gdk::EventMask::STRUCTURE_MASK mask. GDK will enable this mask automatically for all new windows.

event

the gdk::EventWindowState which triggered this signal.

Returns

true to stop other handlers from being invoked for the event. false to propagate the event further.

Available on crate feature v3_20 only.

Implementors