1Gtk2::Widget(3) User Contributed Perl Documentation Gtk2::Widget(3)
2
3
4
6 Gtk2::Widget - wrapper for GtkWidget
7
9 Glib::Object
10 +----Glib::InitiallyUnowned
11 +----Gtk2::Object
12 +----Gtk2::Widget
13
15 Glib::Object::_Unregistered::AtkImplementorIface
16 Gtk2::Buildable
17
19 "EVENT_STOP" and "EVENT_PROPAGATE" are designed for the return from
20 widget event signal handlers and similar, being true to stop or false
21 to propagate. The names can help you avoid confusion over which way is
22 true and which is false. (You can also remember the return as meaning
23 "handled", which is the jargon in a few other signal handler types.)
24
25 Gtk2::EVENT_STOP # true
26 Gtk2::EVENT_PROPAGATE # false
27
29 $widget->set_accel_path ($accel_path, $accel_group)
30 · $accel_path (string or undef)
31
32 · $accel_group (Gtk2::AccelGroup or undef)
33
34 object = $widget->get_accessible
35 action or undef = $widget->get_action
36 Since: gtk+ 2.10
37
38 boolean = $widget->activate
39 This function works by emitting an action signal nominated by the
40 various widget subclasses. The signal is normally called "activate",
41 but it doesn't have to be.
42
43 Currently if you make a widget subclass in Perl there's no way to
44 nominate a signal to be emitted by "$widget->activate". A signal
45 merely named "activate" is not automatically hooked up.
46
47 $widget->add_accelerator ($accel_signal, $accel_group, $accel_key,
48 $accel_mods, $flags)
49 · $accel_signal (string)
50
51 · $accel_group (Gtk2::AccelGroup)
52
53 · $accel_key (integer)
54
55 · $accel_mods (Gtk2::Gdk::ModifierType)
56
57 · $flags (Gtk2::AccelFlags)
58
59 $widget->add_events ($events)
60 · $events (Gtk2::Gdk::EventMask)
61
62 $widget->add_mnemonic_label ($label)
63 · $label (Gtk2::Widget)
64
65 Since: gtk+ 2.4
66
67 rectangle = $widget->allocation
68 Return the current allocated size and position of $widget within its
69 parent widget. The allocated size is not necessarily the same as the
70 requested size.
71
72 The returned rect object points into $widget and can only be used as
73 long as $widget exists.
74
75 rectangle = $widget->get_allocation
76 Since: gtk+ 2.18
77
78 $widget->set_allocation ($allocation)
79 · $allocation (Gtk2::Gdk::Rectangle)
80
81 Since: gtk+ 2.18
82
83 widget or undef = $widget->get_ancestor ($ancestor_package)
84 · $ancestor_package (string)
85
86 $widget->app_paintable ($boolean)
87 boolean = $widget->app_paintable
88 boolean = $widget->get_app_paintable
89 Since: gtk+ 2.18
90
91 $widget->set_app_paintable ($app_paintable)
92 · $app_paintable (boolean)
93
94 boolean = $widget->can_activate_accel ($signal_id)
95 · $signal_id (integer)
96
97 Since: gtk+ 2.4
98
99 $widget->can_default ($boolean)
100 boolean = $widget->can_default
101 boolean = $widget->get_can_default
102 Since: gtk+ 2.18
103
104 $widget->set_can_default ($can_default)
105 · $can_default (boolean)
106
107 Since: gtk+ 2.18
108
109 $widget->can_focus ($boolean)
110 boolean = $widget->can_focus
111 boolean = $widget->get_can_focus
112 Since: gtk+ 2.18
113
114 $widget->set_can_focus ($can_focus)
115 · $can_focus (boolean)
116
117 Since: gtk+ 2.18
118
119 boolean = $widget->child_focus ($direction)
120 · $direction (Gtk2::DirectionType)
121
122 $widget->child_notify ($child_property)
123 · $child_property (string)
124
125 requisition = $widget->get_child_requisition
126 This function is only for use in widget implementations. Obtains
127 "$widget->requisition", unless someone has forced a particular geometry
128 on the widget (e.g., with "set_usize()", in which case it returns that
129 geometry instead of the widget's requisition.
130
131 This function differs from size_request() in that it retrieves the last
132 size request value from "$widget->requisition", while "size_request()"
133 actually calls the "size_request" virtual method (that is, emits the
134 "size-request" signal) on the $widget to compute the size request and
135 fill in "$widget->requisition", and only then returns
136 "$widget->requisition".
137
138 Because this function does not call the "size_request" method, it can
139 only be used when you know that "$widget->requisition" is up-to-date.
140 In general, only container implementations have this information;
141 applications should use "size_request ()".
142
143 boolean = $widget->get_child_visible
144 $widget->set_child_visible ($is_visible)
145 · $is_visible (boolean)
146
147 (path, path_reversed) = $widget->class_path
148 clipboard = $widget->get_clipboard ($selection=GDK_SELECTION_CLIPBOARD)
149 · $selection (Gtk2::Gdk::Atom)
150
151 Since: gtk+ 2.2
152
153 colormap = $widget->get_colormap
154 $widget->set_colormap ($colormap)
155 · $colormap (Gtk2::Gdk::Colormap)
156
157 $widget->composite_child ($boolean)
158 boolean = $widget->composite_child
159 string or undef = $widget->get_composite_name
160 $widget->set_composite_name ($name)
161 · $name (string)
162
163 context = $widget->create_pango_context
164 layout = $widget->create_pango_layout ($text=undef)
165 · $text (string or undef)
166
167 colormap = Gtk2::Widget->get_default_colormap
168 colormap = $widget->get_default_colormap
169 Gtk2::Widget->set_default_colormap ($colormap)
170 $widget->set_default_colormap ($colormap)
171 · $colormap (Gtk2::Gdk::Colormap)
172
173 textdirection = Gtk2::Widget->get_default_direction
174 Gtk2::Widget->set_default_direction ($dir)
175 · $dir (Gtk2::TextDirection)
176
177 style = Gtk2::Widget->get_default_style
178 style = $widget->get_default_style
179 visual = Gtk2::Widget->get_default_visual
180 visual = $widget->get_default_visual
181 $widget->destroy
182 textdirection = $widget->get_direction
183 $widget->set_direction ($dir)
184 · $dir (Gtk2::TextDirection)
185
186 display = $widget->get_display
187 Since: gtk+ 2.2
188
189 $widget->double_buffered ($boolean)
190 boolean = $widget->double_buffered
191 boolean = $widget->get_double_buffered
192 Since: gtk+ 2.18
193
194 $widget->set_double_buffered ($double_buffered)
195 · $double_buffered (boolean)
196
197 dragcontext = $widget->drag_begin ($targets, $actions, $button, $event)
198 · $targets (Gtk2::TargetList)
199
200 · $actions (Gtk2::Gdk::DragAction)
201
202 · $button (integer)
203
204 · $event (Gtk2::Gdk::Event)
205
206 boolean = $widget->drag_check_threshold ($start_x, $start_y, $current_x,
207 $current_y)
208 · $start_x (integer)
209
210 · $start_y (integer)
211
212 · $current_x (integer)
213
214 · $current_y (integer)
215
216 $widget->drag_dest_add_image_targets
217 Since: gtk+ 2.6
218
219 $widget->drag_dest_add_text_targets
220 Since: gtk+ 2.6
221
222 $widget->drag_dest_add_uri_targets
223 Since: gtk+ 2.6
224
225 atom = $widget->drag_dest_find_target ($context, $target_list)
226 · $context (Gtk2::Gdk::DragContext)
227
228 · $target_list (Gtk2::TargetList or undef)
229
230 targetlist or undef = $widget->drag_dest_get_target_list
231 boolean = $widget->drag_dest_get_track_motion
232 Since: gtk+ 2.10
233
234 $widget->drag_dest_set ($flags, $actions, ...)
235 · $flags (Gtk2::DestDefaults)
236
237 · $actions (Gtk2::Gdk::DragAction)
238
239 · ... (list) of Gtk2::TargetEntry's
240
241 $widget->drag_dest_set_proxy ($proxy_window, $protocol, $use_coordinates)
242 · $proxy_window (Gtk2::Gdk::Window)
243
244 · $protocol (Gtk2::Gdk::DragProtocol)
245
246 · $use_coordinates (boolean)
247
248 $widget->drag_dest_set_target_list ($target_list)
249 · $target_list (Gtk2::TargetList or undef)
250
251 $widget->drag_dest_set_track_motion ($track_motion)
252 · $track_motion (boolean)
253
254 Since: gtk+ 2.10
255
256 $widget->drag_dest_unset
257 $widget->drag_get_data ($context, $target, $time_)
258 · $context (Gtk2::Gdk::DragContext)
259
260 · $target (Gtk2::Gdk::Atom)
261
262 · $time_ (unsigned)
263
264 $widget->drag_highlight
265 $widget->drag_source_add_image_targets
266 Since: gtk+ 2.6
267
268 $widget->drag_source_add_text_targets
269 Since: gtk+ 2.6
270
271 $widget->drag_source_add_uri_targets
272 Since: gtk+ 2.6
273
274 targetlist or undef = $widget->drag_source_get_target_list
275 Since: gtk+ 2.4
276
277 $widget->drag_source_set ($start_button_mask, $actions, ...)
278 · $start_button_mask (Gtk2::Gdk::ModifierType)
279
280 · $actions (Gtk2::Gdk::DragAction)
281
282 · ... (list) of Gtk2::TargetEntry's
283
284 $widget->drag_source_set_icon ($colormap, $pixmap, $mask)
285 · $colormap (Gtk2::Gdk::Colormap or undef)
286
287 · $pixmap (Gtk2::Gdk::Pixmap or undef)
288
289 · $mask (Gtk2::Gdk::Bitmap or undef)
290
291 $widget->drag_source_set_icon_name ($icon_name)
292 · $icon_name (string)
293
294 Since: gtk+ 2.8
295
296 $widget->drag_source_set_icon_pixbuf ($pixbuf)
297 · $pixbuf (Gtk2::Gdk::Pixbuf or undef)
298
299 $widget->drag_source_set_icon_stock ($stock_id)
300 · $stock_id (string)
301
302 $widget->drag_source_set_target_list ($target_list)
303 · $target_list (Gtk2::TargetList or undef)
304
305 Since: gtk+ 2.4
306
307 $widget->drag_source_unset
308 $widget->drag_unhighlight
309 $widget->drawable ($boolean)
310 boolean = $widget->drawable
311 $widget->ensure_style
312 $widget->error_bell
313 Since: gtk+ 2.12
314
315 boolean = $widget->event ($event)
316 · $event (Gtk2::Gdk::Event)
317
318 This rarely-used function emits an event signal on $widget. Don't use
319 this to synthesize events; use "Gtk2->main_do_event" instead. Don't
320 synthesize expose events; use "$gdkwindow->invalidate_rect" instead.
321 Basically, the main use for this in gtk2-perl will be to pass motion
322 notify events to rulers from other widgets.
323
324 eventmask = $widget->get_events
325 $widget->set_events ($events)
326 · $events (Gtk2::Gdk::EventMask)
327
328 extensionmode = $widget->get_extension_events
329 $widget->set_extension_events ($mode)
330 · $mode (Gtk2::Gdk::ExtensionMode)
331
332 pspec or undef = $widget_or_class_name->find_style_property ($name)
333 · $name (string)
334
335 Return a "Glib::ParamSpec" for style property $name on widget
336 $widget_or_class_name. If there's no property $name then return
337 "undef". See Glib::Object "list_properties" for the fields in a
338 ParamSpec.
339
340 Since: gtk+ 2.2
341
342 widgetflags = $widget->flags
343 widgetflags = $widget->get_flags
344 $widget->set_flags ($flags)
345 · $flags (Gtk2::WidgetFlags)
346
347 $widget->freeze_child_notify
348 $widget->grab_default
349 $widget->grab_focus
350 $widget->has_default ($boolean)
351 boolean = $widget->has_default
352 $widget->has_focus ($boolean)
353 boolean = $widget->has_focus
354 $widget->has_grab ($boolean)
355 boolean = $widget->has_grab
356 boolean = $widget->has_rc_style
357 Since: gtk+ 2.20
358
359 boolean = $widget->has_screen
360 Since: gtk+ 2.2
361
362 boolean = $widget->get_has_tooltip
363 Since: gtk+ 2.12
364
365 $widget->set_has_tooltip ($has_tooltip)
366 · $has_tooltip (boolean)
367
368 Since: gtk+ 2.12
369
370 boolean = $widget->get_has_window
371 Since: gtk+ 2.18
372
373 $widget->set_has_window ($has_window)
374 · $has_window (boolean)
375
376 Since: gtk+ 2.18
377
378 $widget->hide
379 $widget->hide_all
380 boolean = Gtk2::Widget::hide_on_delete ($widget, ...)
381 · $widget (Gtk2::Widget)
382
383 · ... (list) other arguments ignored (event etc)
384
385 This is a helper function intended to be used as the callback for the
386 "delete-event" signal:
387
388 $wiget->signal_connect (
389 delete_event => \&Gtk2::Widget::hide_on_delete);
390
391 $widget->input_shape_combine_mask ($shape_mask, $offset_x, $offset_y)
392 · $shape_mask (Gtk2::Gdk::Bitmap or undef)
393
394 · $offset_x (integer)
395
396 · $offset_y (integer)
397
398 Since: gtk+ 2.10
399
400 rectangle = $widget->intersect ($area)
401 · $area (Gtk2::Gdk::Rectangle)
402
403 Returns undef if $widget and $area do not intersect.
404
405 boolean = $widget->is_ancestor ($ancestor)
406 · $ancestor (Gtk2::Widget)
407
408 boolean = $widget->is_composited
409 Since: gtk+ 2.10
410
411 boolean = $widget->is_drawable
412 Since: gtk+ 2.18
413
414 boolean = $widget->is_focus
415 $widget->is_sensitive ($boolean)
416 boolean = $widget->is_sensitive
417 boolean = $widget->is_toplevel
418 Since: gtk+ 2.18
419
420 boolean = $widget->keynav_failed ($direction)
421 · $direction (Gtk2::DirectionType)
422
423 Since: gtk+ 2.12
424
425 list = $widget->list_mnemonic_labels
426 Since: gtk+ 2.4
427
428 list = $widget_or_class_name->list_style_properties
429 Return a list of "Glib::ParamSpec" objects which are the style
430 properties available on $widget_or_class_name. See Glib::Object
431 "list_properties" for the fields in a ParamSpec.
432
433 Since: gtk+ 2.2
434
435 $widget->map
436 $widget->mapped ($boolean)
437 boolean = $widget->mapped
438 boolean = $widget->get_mapped
439 Since: gtk+ 2.20
440
441 $widget->set_mapped ($mapped)
442 · $mapped (boolean)
443
444 Since: gtk+ 2.20
445
446 boolean = $widget->mnemonic_activate ($group_cycling)
447 · $group_cycling (boolean)
448
449 rcstyle = $widget->get_modifier_style
450 $widget->modify_base ($state, $color)
451 · $state (Gtk2::StateType)
452
453 · $color (Gtk2::Gdk::Color or undef)
454
455 $widget->modify_bg ($state, $color)
456 · $state (Gtk2::StateType)
457
458 · $color (Gtk2::Gdk::Color or undef)
459
460 $widget->modify_cursor ($primary, $secondary)
461 · $primary (Gtk2::Gdk::Color or undef)
462
463 · $secondary (Gtk2::Gdk::Color or undef)
464
465 Since: gtk+ 2.12
466
467 $widget->modify_fg ($state, $color)
468 · $state (Gtk2::StateType)
469
470 · $color (Gtk2::Gdk::Color or undef)
471
472 $widget->modify_font ($font_desc)
473 · $font_desc (Pango::FontDescription or undef)
474
475 $widget->modify_style ($style)
476 · $style (Gtk2::RcStyle)
477
478 $widget->modify_text ($state, $color)
479 · $state (Gtk2::StateType)
480
481 · $color (Gtk2::Gdk::Color or undef)
482
483 string = $widget->get_name
484 $widget->set_name ($name)
485 · $name (string)
486
487 boolean = $widget->get_no_show_all
488 Since: gtk+ 2.4
489
490 $widget->set_no_show_all ($no_show_all)
491 · $no_show_all (boolean)
492
493 Since: gtk+ 2.4
494
495 $widget->no_window ($boolean)
496 boolean = $widget->no_window
497 context = $widget->get_pango_context
498 widget or undef = $widget->parent
499 widget or undef = $widget->get_parent
500 $widget->parent_sensitive ($boolean)
501 boolean = $widget->parent_sensitive
502 $widget->set_parent ($parent)
503 · $parent (Gtk2::Widget)
504
505 window = $widget->get_parent_window
506 $widget->set_parent_window ($parent_window)
507 · $parent_window (Gtk2::Gdk::Window)
508
509 (path, path_reversed) = $widget->path
510 (x, y) = $widget->get_pointer
511 Gtk2::Widget->pop_colormap (cmap)
512 $widget->pop_colormap (cmap)
513 Gtk2::Widget->pop_composite_child
514 $widget->pop_composite_child
515 $widget->propagate_event ($event)
516 · $event (Gtk2::Gdk::Event)
517
518 From gtk+'s API documentation:
519
520 You most likely don't want to use any of these functions; synthesizing
521 events is rarely needed. Consider asking on the mailing list for better
522 ways to achieve your goals. For example, use Gtk2::Gdk::invalidate_rect
523 or Gtk2::Widget::queue_draw instead of making up expose events.
524
525 Gtk2::Widget->push_colormap (cmap)
526 $widget->push_colormap (cmap)
527 · $cmap (Gtk2::Gdk::Colormap)
528
529 Gtk2::Widget->push_composite_child
530 $widget->push_composite_child
531 $widget->queue_draw
532 $widget->queue_draw_area ($x, $y, $width, $height)
533 · $x (integer)
534
535 · $y (integer)
536
537 · $width (integer)
538
539 · $height (integer)
540
541 $widget->queue_resize
542 $widget->queue_resize_no_redraw
543 Since: gtk+ 2.4
544
545 $widget->rc_style ($boolean)
546 boolean = $widget->rc_style
547 $widget->realize
548 $widget->realized ($boolean)
549 boolean = $widget->realized
550 boolean = $widget->get_realized
551 Since: gtk+ 2.20
552
553 $widget->set_realized ($realized)
554 · $realized (boolean)
555
556 Since: gtk+ 2.20
557
558 $widget->receives_default ($boolean)
559 boolean = $widget->receives_default
560 boolean = $widget->get_receives_default
561 Since: gtk+ 2.18
562
563 $widget->set_receives_default ($receives_default)
564 · $receives_default (boolean)
565
566 Since: gtk+ 2.18
567
568 $widget->set_redraw_on_allocate ($redraw_on_allocate)
569 · $redraw_on_allocate (boolean)
570
571 region = $widget->region_intersect ($region)
572 · $region (Gtk2::Gdk::Region)
573
574 boolean = $widget->remove_accelerator ($accel_group, $accel_key,
575 $accel_mods)
576 · $accel_group (Gtk2::AccelGroup)
577
578 · $accel_key (integer)
579
580 · $accel_mods (Gtk2::Gdk::ModifierType)
581
582 $widget->remove_mnemonic_label ($label)
583 · $label (Gtk2::Widget)
584
585 Since: gtk+ 2.4
586
587 pixbuf = $widget->render_icon ($stock_id, $size, $detail=undef)
588 · $stock_id (string)
589
590 · $size (Gtk2::IconSize)
591
592 · $detail (string)
593
594 $widget->reparent ($new_parent)
595 · $new_parent (Gtk2::Widget)
596
597 requisition = $widget->requisition
598 Return the currently desired width and height of $widget. Basically
599 this is the result from the last "size_request" call on $widget, and
600 therefore may not be up-to-date if $widget has asked for a resize but
601 its container parent has not yet called "size_request".
602
603 The returned requisition object points into $widget and can only be
604 used as long as $widget exists.
605
606 requisition = $widget->get_requisition
607 Since: gtk+ 2.20
608
609 $widget->reset_rc_styles
610 $widget->reset_shapes
611 window = $widget->get_root_window
612 Since: gtk+ 2.2
613
614 statetype = $widget->saved_state
615 screen = $widget->get_screen
616 Since: gtk+ 2.2
617
618 boolean = $widget->set_scroll_adjustments ($hadjustment, $vadjustment)
619 · $hadjustment (Gtk2::Adjustment or undef)
620
621 · $vadjustment (Gtk2::Adjustment or undef)
622
623 This function works by emitting a setter signal nominated by the
624 various widget types which have "native" scrolling. The signal is
625 normally called "set-scroll-adjustments", but it doesn't have to be.
626
627 If you make a widget subclass in Perl and create a signal in it called
628 "set-scroll-adjustments" taking two Gtk2::Adjustment parameters then
629 the subclassing automatically hooks that up to be emitted by
630 "$widget->set_scroll_adjustments". (Your "class closure" default
631 handler code should then store the adjustment objects somewhere.)
632
633 $widget->selection_add_target ($selection, $target, $info)
634 · $selection (Gtk2::Gdk::Atom)
635
636 · $target (Gtk2::Gdk::Atom)
637
638 · $info (integer)
639
640 $widget->selection_add_targets ($selection, ...)
641 · $selection (Gtk2::Gdk::Atom)
642
643 · ... (list) of Gtk2::TargetEntry's
644
645 $widget->selection_clear_targets ($selection)
646 · $selection (Gtk2::Gdk::Atom)
647
648 boolean = $widget->selection_convert ($selection, $target, $time_)
649 · $selection (Gtk2::Gdk::Atom)
650
651 · $target (Gtk2::Gdk::Atom)
652
653 · $time_ (unsigned)
654
655 $widget->selection_remove_all
656 boolean = $widget->send_focus_change ($event)
657 · $event (Gtk2::Gdk::Event)
658
659 Since: gtk+ 2.22
660
661 $widget->sensitive ($boolean)
662 boolean = $widget->sensitive
663 boolean = $widget->get_sensitive
664 Since: gtk+ 2.18
665
666 $widget->set_sensitive ($sensitive)
667 · $sensitive (boolean)
668
669 settings = $widget->get_settings
670 $widget->shape_combine_mask ($shape_mask, $offset_x, $offset_y)
671 · $shape_mask (Gtk2::Gdk::Bitmap or undef)
672
673 · $offset_x (integer)
674
675 · $offset_y (integer)
676
677 $widget->show
678 $widget->show_all
679 $widget->show_now
680 $widget->size_allocate ($allocation)
681 · $allocation (Gtk2::Gdk::Rectangle)
682
683 requisition = $widget->size_request
684 This function is typically used when implementing a GtkContainer
685 subclass. Obtains the preferred size of a widget. The container uses
686 this information to arrange its child widgets and decide what size
687 allocations to give them with size_allocate ().
688
689 You can also call this function from an application, with some caveats.
690 Most notably, getting a size request requires the widget to be
691 associated with a screen, because font information may be needed.
692 Multihead-aware applications should keep this in mind.
693
694 Also remember that the size request is not necessarily the size a
695 widget will actually be allocated.
696
697 See also get_child_requisition ()
698
699 (width, height) = $widget->get_size_request
700 Gets the size request that was explicitly set for the widget using
701 "set_size_request()". A value of -1 for width or height indicates that
702 the dimension has not been explicitly set and the natural requisition
703 of the widget will be used instead. See set_size_request(). To get
704 the size a widget will actually use, call size_request() instead of
705 this function.
706
707 $widget->set_size_request ($width=-1, $height=-1)
708 · $width (integer)
709
710 · $height (integer)
711
712 pixmap or undef = $widget->get_snapshot ($clip_rect=undef)
713 · $clip_rect (Gtk2::Gdk::Rectangle or undef)
714
715 Since: gtk+ 2.14
716
717 statetype = $widget->state
718 statetype = $widget->get_state
719 Since: gtk+ 2.18
720
721 $widget->set_state ($state)
722 · $state (Gtk2::StateType)
723
724 style = $widget->style
725 $style->style_attach
726 Since: gtk+ 2.20
727
728 style = $widget->get_style
729 list = $widget->style_get ($first_property_name, ...)
730 · $first_property_name (string)
731
732 · ... (list) 0 or more additional property names
733
734 Returns the values of the requested style properties.
735
736 Since: gtk+ 2.2
737
738 list = $widget->style_get_property ($first_property_name, ...)
739 · $first_property_name (string)
740
741 · ... (list) 0 or more additional property names
742
743 An alias for style_get.
744
745 Since: gtk+ 2.2
746
747 $widget->set_style ($style)
748 · $style (Gtk2::Style or undef)
749
750 $widget->thaw_child_notify
751 string = $widget->get_tooltip_markup
752 Since: gtk+ 2.12
753
754 $widget->set_tooltip_markup ($markup)
755 · $markup (string or undef)
756
757 Since: gtk+ 2.12
758
759 string = $widget->get_tooltip_text
760 Since: gtk+ 2.12
761
762 $widget->set_tooltip_text ($text)
763 · $text (string or undef)
764
765 Since: gtk+ 2.12
766
767 window or undef = $widget->get_tooltip_window
768 Since: gtk+ 2.12
769
770 $widget->set_tooltip_window ($custom_window)
771 · $custom_window (Gtk2::Window or undef)
772
773 Since: gtk+ 2.12
774
775 $widget->toplevel ($value)
776 boolean = $widget->toplevel
777 widget = $widget->get_toplevel
778 (dst_x, dst_y) = $src_widget->translate_coordinates ($dest_widget, $src_x,
779 $src_y)
780 · $dest_widget (Gtk2::Widget)
781
782 · $src_x (integer)
783
784 · $src_y (integer)
785
786 Returns an empty list if either widget is not realized or if they do
787 not share a common ancestor.
788
789 $widget->trigger_tooltip_query
790 Since: gtk+ 2.12
791
792 $widget->unmap
793 $widget->unparent
794 $widget->unrealize
795 $widget->unset_flags ($flags)
796 · $flags (Gtk2::WidgetFlags)
797
798 $widget->visible ($boolean)
799 boolean = $widget->visible
800 boolean = $widget->get_visible
801 Since: gtk+ 2.18
802
803 $widget->set_visible ($visible)
804 · $visible (boolean)
805
806 Since: gtk+ 2.18
807
808 visual = $widget->get_visual
809 window or undef = $widget->window ($new=undef)
810 · $new (Gtk2::Gdk::Window or undef)
811
812 window or undef = $widget->get_window
813 Since: gtk+ 2.14
814
815 $widget->set_window ($window)
816 · $window (Gtk2::Gdk::Window)
817
818 Since: gtk+ 2.18
819
821 'app-paintable' (boolean : default false : readable / writable /
822 private / static-nick / static-blurb)
823 Whether the application will paint directly on the widget
824
825 'can-default' (boolean : default false : readable / writable / private
826 / static-nick / static-blurb)
827 Whether the widget can be the default widget
828
829 'can-focus' (boolean : default false : readable / writable / private /
830 static-nick / static-blurb)
831 Whether the widget can accept the input focus
832
833 'composite-child' (boolean : default false : readable / private /
834 static-nick / static-blurb)
835 Whether the widget is part of a composite widget
836
837 'double-buffered' (boolean : default true : readable / writable /
838 private / static-nick / static-blurb)
839 Whether or not the widget is double buffered
840
841 'events' (Gtk2::Gdk::EventMask : default structure-mask : readable /
842 writable / private / static-nick / static-blurb)
843 The event mask that decides what kind of GdkEvents this widget gets
844
845 'extension-events' (Gtk2::Gdk::ExtensionMode : default "none" :
846 readable / writable / private / static-nick / static-blurb)
847 The mask that decides what kind of extension events this widget
848 gets
849
850 'has-default' (boolean : default false : readable / writable / private
851 / static-nick / static-blurb)
852 Whether the widget is the default widget
853
854 'has-focus' (boolean : default false : readable / writable / private /
855 static-nick / static-blurb)
856 Whether the widget has the input focus
857
858 'has-tooltip' (boolean : default false : readable / writable / private
859 / static-nick / static-blurb)
860 Whether this widget has a tooltip
861
862 'height-request' (integer : default -1 : readable / writable / private
863 / static-nick / static-blurb)
864 Override for height request of the widget, or -1 if natural request
865 should be used
866
867 'is-focus' (boolean : default false : readable / writable / private /
868 static-nick / static-blurb)
869 Whether the widget is the focus widget within the toplevel
870
871 'name' (string : default undef : readable / writable / private /
872 static-nick / static-blurb)
873 The name of the widget
874
875 'no-show-all' (boolean : default false : readable / writable / private
876 / static-nick / static-blurb)
877 Whether gtk_widget_show_all() should not affect this widget
878
879 'parent' (Gtk2::Container : default undef : readable / writable /
880 private / static-nick / static-blurb)
881 The parent widget of this widget. Must be a Container widget
882
883 'receives-default' (boolean : default false : readable / writable /
884 private / static-nick / static-blurb)
885 If TRUE, the widget will receive the default action when it is
886 focused
887
888 'sensitive' (boolean : default true : readable / writable / private /
889 static-nick / static-blurb)
890 Whether the widget responds to input
891
892 'style' (Gtk2::Style : default undef : readable / writable / private /
893 static-nick / static-blurb)
894 The style of the widget, which contains information about how it
895 will look (colors etc)
896
897 'tooltip-markup' (string : default undef : readable / writable /
898 private / static-nick / static-blurb)
899 The contents of the tooltip for this widget
900
901 'tooltip-text' (string : default undef : readable / writable / private
902 / static-nick / static-blurb)
903 The contents of the tooltip for this widget
904
905 'visible' (boolean : default false : readable / writable / private /
906 static-nick / static-blurb)
907 Whether the widget is visible
908
909 'width-request' (integer : default -1 : readable / writable / private /
910 static-nick / static-blurb)
911 Override for width request of the widget, or -1 if natural request
912 should be used
913
914 'window' (Gtk2::Gdk::Window : default undef : readable / private /
915 static-nick / static-blurb)
916 The widget's window if it is realized
917
919 'cursor-aspect-ratio' (float : default 0.04 : readable / private /
920 static-nick / static-blurb)
921 Aspect ratio with which to draw insertion cursor
922
923 'cursor-color' (Gtk2::Gdk::Color : default undef : readable / private /
924 static-nick / static-blurb)
925 Color with which to draw insertion cursor
926
927 'draw-border' (Gtk2::Border : default undef : readable / private /
928 static-nick / static-blurb)
929 Size of areas outside the widget's allocation to draw
930
931 'focus-line-pattern' (string : default "\1\1" : readable / private /
932 static-nick / static-blurb)
933 Dash pattern used to draw the focus indicator
934
935 'focus-line-width' (integer : default 1 : readable / private / static-
936 nick / static-blurb)
937 Width, in pixels, of the focus indicator line
938
939 'focus-padding' (integer : default 1 : readable / private / static-nick
940 / static-blurb)
941 Width, in pixels, between focus indicator and the widget 'box'
942
943 'interior-focus' (boolean : default true : readable / private / static-
944 nick / static-blurb)
945 Whether to draw the focus indicator inside widgets
946
947 'link-color' (Gtk2::Gdk::Color : default undef : readable / private /
948 static-nick / static-blurb)
949 Color of unvisited links
950
951 'scroll-arrow-hlength' (integer : default 16 : readable / private /
952 static-nick / static-blurb)
953 The length of horizontal scroll arrows
954
955 'scroll-arrow-vlength' (integer : default 16 : readable / private /
956 static-nick / static-blurb)
957 The length of vertical scroll arrows
958
959 'secondary-cursor-color' (Gtk2::Gdk::Color : default undef : readable /
960 private / static-nick / static-blurb)
961 Color with which to draw the secondary insertion cursor when
962 editing mixed right-to-left and left-to-right text
963
964 'separator-height' (integer : default 0 : readable / private / static-
965 nick / static-blurb)
966 The height of separators if "wide-separators" is TRUE
967
968 'separator-width' (integer : default 0 : readable / private / static-
969 nick / static-blurb)
970 The width of separators if wide-separators is TRUE
971
972 'tooltip-alpha' (Glib::UChar : default 255 : readable / private /
973 static-nick / static-blurb)
974 The opacity to be used when drawing tooltips
975
976 'tooltip-radius' (Glib::UInt : default 0 : readable / private / static-
977 nick / static-blurb)
978 The radius to be used when drawing tooltips
979
980 'visited-link-color' (Gtk2::Gdk::Color : default undef : readable /
981 private / static-nick / static-blurb)
982 Color of visited links
983
984 'wide-separators' (boolean : default false : readable / private /
985 static-nick / static-blurb)
986 Whether separators have configurable width and should be drawn
987 using a box instead of a line
988
989 'window-dragging' (boolean : default false : readable / writable /
990 private / static-nick / static-blurb)
991 Window dragging
992
994 accel-closures-changed (Gtk2::Widget)
995 boolean = button-press-event (Gtk2::Widget, Gtk2::Gdk::Event)
996 boolean = button-release-event (Gtk2::Widget, Gtk2::Gdk::Event)
997 boolean = can-activate-accel (Gtk2::Widget, Glib::UInt)
998 child-notify (Gtk2::Widget, Glib::ParamSpec)
999 boolean = client-event (Gtk2::Widget, Gtk2::Gdk::Event)
1000 composited-changed (Gtk2::Widget)
1001 boolean = configure-event (Gtk2::Widget, Gtk2::Gdk::Event)
1002 boolean = damage-event (Gtk2::Widget, Gtk2::Gdk::Event)
1003 boolean = delete-event (Gtk2::Widget, Gtk2::Gdk::Event)
1004 boolean = destroy-event (Gtk2::Widget, Gtk2::Gdk::Event)
1005 direction-changed (Gtk2::Widget, Gtk2::TextDirection)
1006 drag-begin (Gtk2::Widget, Gtk2::Gdk::DragContext)
1007 drag-data-delete (Gtk2::Widget, Gtk2::Gdk::DragContext)
1008 drag-data-get (Gtk2::Widget, Gtk2::Gdk::DragContext,
1009 Gtk2::SelectionData, Glib::UInt, Glib::UInt)
1010 drag-data-received (Gtk2::Widget, Gtk2::Gdk::DragContext, integer,
1011 integer, Gtk2::SelectionData, Glib::UInt, Glib::UInt)
1012 boolean = drag-drop (Gtk2::Widget, Gtk2::Gdk::DragContext, integer,
1013 integer, Glib::UInt)
1014 drag-end (Gtk2::Widget, Gtk2::Gdk::DragContext)
1015 boolean = drag-failed (Gtk2::Widget, Gtk2::Gdk::DragContext,
1016 Gtk2::DragResult)
1017 drag-leave (Gtk2::Widget, Gtk2::Gdk::DragContext, Glib::UInt)
1018 boolean = drag-motion (Gtk2::Widget, Gtk2::Gdk::DragContext, integer,
1019 integer, Glib::UInt)
1020 boolean = enter-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1021 boolean = event (Gtk2::Widget, Gtk2::Gdk::Event)
1022 event-after (Gtk2::Widget, Gtk2::Gdk::Event)
1023 boolean = expose-event (Gtk2::Widget, Gtk2::Gdk::Event)
1024 boolean = focus (Gtk2::Widget, Gtk2::DirectionType)
1025 boolean = focus-in-event (Gtk2::Widget, Gtk2::Gdk::Event)
1026 boolean = focus-out-event (Gtk2::Widget, Gtk2::Gdk::Event)
1027 boolean = grab-broken-event (Gtk2::Widget, Gtk2::Gdk::Event)
1028 grab-focus (Gtk2::Widget)
1029 grab-notify (Gtk2::Widget, boolean)
1030 hide (Gtk2::Widget)
1031 hierarchy-changed (Gtk2::Widget, Gtk2::Widget)
1032 boolean = key-press-event (Gtk2::Widget, Gtk2::Gdk::Event)
1033 boolean = key-release-event (Gtk2::Widget, Gtk2::Gdk::Event)
1034 boolean = keynav-failed (Gtk2::Widget, Gtk2::DirectionType)
1035 boolean = leave-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1036 map (Gtk2::Widget)
1037 boolean = map-event (Gtk2::Widget, Gtk2::Gdk::Event)
1038 boolean = mnemonic-activate (Gtk2::Widget, boolean)
1039 boolean = motion-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1040 move-focus (Gtk2::Widget, Gtk2::DirectionType)
1041 boolean = no-expose-event (Gtk2::Widget, Gtk2::Gdk::Event)
1042 parent-set (Gtk2::Widget, Gtk2::Widget)
1043 boolean = popup-menu (Gtk2::Widget)
1044 boolean = property-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1045 boolean = proximity-in-event (Gtk2::Widget, Gtk2::Gdk::Event)
1046 boolean = proximity-out-event (Gtk2::Widget, Gtk2::Gdk::Event)
1047 boolean = query-tooltip (Gtk2::Widget, integer, integer, boolean,
1048 Gtk2::Tooltip)
1049 realize (Gtk2::Widget)
1050 screen-changed (Gtk2::Widget, Gtk2::Gdk::Screen)
1051 boolean = scroll-event (Gtk2::Widget, Gtk2::Gdk::Event)
1052 boolean = selection-clear-event (Gtk2::Widget, Gtk2::Gdk::Event)
1053 selection-get (Gtk2::Widget, Gtk2::SelectionData, Glib::UInt,
1054 Glib::UInt)
1055 boolean = selection-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1056 selection-received (Gtk2::Widget, Gtk2::SelectionData, Glib::UInt)
1057 boolean = selection-request-event (Gtk2::Widget, Gtk2::Gdk::Event)
1058 show (Gtk2::Widget)
1059 boolean = show-help (Gtk2::Widget, Gtk2::WidgetHelpType)
1060 size-allocate (Gtk2::Widget, Gtk2::Gdk::Rectangle)
1061 size-request (Gtk2::Widget, Gtk2::Requisition)
1062 state-changed (Gtk2::Widget, Gtk2::StateType)
1063 style-set (Gtk2::Widget, Gtk2::Style)
1064 unmap (Gtk2::Widget)
1065 boolean = unmap-event (Gtk2::Widget, Gtk2::Gdk::Event)
1066 unrealize (Gtk2::Widget)
1067 boolean = visibility-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1068 boolean = window-state-event (Gtk2::Widget, Gtk2::Gdk::Event)
1069
1071 flags Gtk2::AccelFlags
1072 · 'visible' / 'GTK_ACCEL_VISIBLE'
1073
1074 · 'locked' / 'GTK_ACCEL_LOCKED'
1075
1076 · 'mask' / 'GTK_ACCEL_MASK'
1077
1078 flags Gtk2::DestDefaults
1079 · 'motion' / 'GTK_DEST_DEFAULT_MOTION'
1080
1081 · 'highlight' / 'GTK_DEST_DEFAULT_HIGHLIGHT'
1082
1083 · 'drop' / 'GTK_DEST_DEFAULT_DROP'
1084
1085 · 'all' / 'GTK_DEST_DEFAULT_ALL'
1086
1087 enum Gtk2::DirectionType
1088 · 'tab-forward' / 'GTK_DIR_TAB_FORWARD'
1089
1090 · 'tab-backward' / 'GTK_DIR_TAB_BACKWARD'
1091
1092 · 'up' / 'GTK_DIR_UP'
1093
1094 · 'down' / 'GTK_DIR_DOWN'
1095
1096 · 'left' / 'GTK_DIR_LEFT'
1097
1098 · 'right' / 'GTK_DIR_RIGHT'
1099
1100 enum Gtk2::DragResult
1101 · 'success' / 'GTK_DRAG_RESULT_SUCCESS'
1102
1103 · 'no-target' / 'GTK_DRAG_RESULT_NO_TARGET'
1104
1105 · 'user-cancelled' / 'GTK_DRAG_RESULT_USER_CANCELLED'
1106
1107 · 'timeout-expired' / 'GTK_DRAG_RESULT_TIMEOUT_EXPIRED'
1108
1109 · 'grab-broken' / 'GTK_DRAG_RESULT_GRAB_BROKEN'
1110
1111 · 'error' / 'GTK_DRAG_RESULT_ERROR'
1112
1113 flags Gtk2::Gdk::DragAction
1114 · 'default' / 'GDK_ACTION_DEFAULT'
1115
1116 · 'copy' / 'GDK_ACTION_COPY'
1117
1118 · 'move' / 'GDK_ACTION_MOVE'
1119
1120 · 'link' / 'GDK_ACTION_LINK'
1121
1122 · 'private' / 'GDK_ACTION_PRIVATE'
1123
1124 · 'ask' / 'GDK_ACTION_ASK'
1125
1126 enum Gtk2::Gdk::DragProtocol
1127 · 'motif' / 'GDK_DRAG_PROTO_MOTIF'
1128
1129 · 'xdnd' / 'GDK_DRAG_PROTO_XDND'
1130
1131 · 'rootwin' / 'GDK_DRAG_PROTO_ROOTWIN'
1132
1133 · 'none' / 'GDK_DRAG_PROTO_NONE'
1134
1135 · 'win32-dropfiles' / 'GDK_DRAG_PROTO_WIN32_DROPFILES'
1136
1137 · 'ole2' / 'GDK_DRAG_PROTO_OLE2'
1138
1139 · 'local' / 'GDK_DRAG_PROTO_LOCAL'
1140
1141 flags Gtk2::Gdk::EventMask
1142 · 'exposure-mask' / 'GDK_EXPOSURE_MASK'
1143
1144 · 'pointer-motion-mask' / 'GDK_POINTER_MOTION_MASK'
1145
1146 · 'pointer-motion-hint-mask' / 'GDK_POINTER_MOTION_HINT_MASK'
1147
1148 · 'button-motion-mask' / 'GDK_BUTTON_MOTION_MASK'
1149
1150 · 'button1-motion-mask' / 'GDK_BUTTON1_MOTION_MASK'
1151
1152 · 'button2-motion-mask' / 'GDK_BUTTON2_MOTION_MASK'
1153
1154 · 'button3-motion-mask' / 'GDK_BUTTON3_MOTION_MASK'
1155
1156 · 'button-press-mask' / 'GDK_BUTTON_PRESS_MASK'
1157
1158 · 'button-release-mask' / 'GDK_BUTTON_RELEASE_MASK'
1159
1160 · 'key-press-mask' / 'GDK_KEY_PRESS_MASK'
1161
1162 · 'key-release-mask' / 'GDK_KEY_RELEASE_MASK'
1163
1164 · 'enter-notify-mask' / 'GDK_ENTER_NOTIFY_MASK'
1165
1166 · 'leave-notify-mask' / 'GDK_LEAVE_NOTIFY_MASK'
1167
1168 · 'focus-change-mask' / 'GDK_FOCUS_CHANGE_MASK'
1169
1170 · 'structure-mask' / 'GDK_STRUCTURE_MASK'
1171
1172 · 'property-change-mask' / 'GDK_PROPERTY_CHANGE_MASK'
1173
1174 · 'visibility-notify-mask' / 'GDK_VISIBILITY_NOTIFY_MASK'
1175
1176 · 'proximity-in-mask' / 'GDK_PROXIMITY_IN_MASK'
1177
1178 · 'proximity-out-mask' / 'GDK_PROXIMITY_OUT_MASK'
1179
1180 · 'substructure-mask' / 'GDK_SUBSTRUCTURE_MASK'
1181
1182 · 'scroll-mask' / 'GDK_SCROLL_MASK'
1183
1184 · 'all-events-mask' / 'GDK_ALL_EVENTS_MASK'
1185
1186 enum Gtk2::Gdk::ExtensionMode
1187 · 'none' / 'GDK_EXTENSION_EVENTS_NONE'
1188
1189 · 'all' / 'GDK_EXTENSION_EVENTS_ALL'
1190
1191 · 'cursor' / 'GDK_EXTENSION_EVENTS_CURSOR'
1192
1193 flags Gtk2::Gdk::ModifierType
1194 · 'shift-mask' / 'GDK_SHIFT_MASK'
1195
1196 · 'lock-mask' / 'GDK_LOCK_MASK'
1197
1198 · 'control-mask' / 'GDK_CONTROL_MASK'
1199
1200 · 'mod1-mask' / 'GDK_MOD1_MASK'
1201
1202 · 'mod2-mask' / 'GDK_MOD2_MASK'
1203
1204 · 'mod3-mask' / 'GDK_MOD3_MASK'
1205
1206 · 'mod4-mask' / 'GDK_MOD4_MASK'
1207
1208 · 'mod5-mask' / 'GDK_MOD5_MASK'
1209
1210 · 'button1-mask' / 'GDK_BUTTON1_MASK'
1211
1212 · 'button2-mask' / 'GDK_BUTTON2_MASK'
1213
1214 · 'button3-mask' / 'GDK_BUTTON3_MASK'
1215
1216 · 'button4-mask' / 'GDK_BUTTON4_MASK'
1217
1218 · 'button5-mask' / 'GDK_BUTTON5_MASK'
1219
1220 · 'super-mask' / 'GDK_SUPER_MASK'
1221
1222 · 'hyper-mask' / 'GDK_HYPER_MASK'
1223
1224 · 'meta-mask' / 'GDK_META_MASK'
1225
1226 · 'release-mask' / 'GDK_RELEASE_MASK'
1227
1228 · 'modifier-mask' / 'GDK_MODIFIER_MASK'
1229
1230 enum Gtk2::IconSize
1231 · 'invalid' / 'GTK_ICON_SIZE_INVALID'
1232
1233 · 'menu' / 'GTK_ICON_SIZE_MENU'
1234
1235 · 'small-toolbar' / 'GTK_ICON_SIZE_SMALL_TOOLBAR'
1236
1237 · 'large-toolbar' / 'GTK_ICON_SIZE_LARGE_TOOLBAR'
1238
1239 · 'button' / 'GTK_ICON_SIZE_BUTTON'
1240
1241 · 'dnd' / 'GTK_ICON_SIZE_DND'
1242
1243 · 'dialog' / 'GTK_ICON_SIZE_DIALOG'
1244
1245 enum Gtk2::StateType
1246 · 'normal' / 'GTK_STATE_NORMAL'
1247
1248 · 'active' / 'GTK_STATE_ACTIVE'
1249
1250 · 'prelight' / 'GTK_STATE_PRELIGHT'
1251
1252 · 'selected' / 'GTK_STATE_SELECTED'
1253
1254 · 'insensitive' / 'GTK_STATE_INSENSITIVE'
1255
1256 enum Gtk2::TextDirection
1257 · 'none' / 'GTK_TEXT_DIR_NONE'
1258
1259 · 'ltr' / 'GTK_TEXT_DIR_LTR'
1260
1261 · 'rtl' / 'GTK_TEXT_DIR_RTL'
1262
1263 flags Gtk2::WidgetFlags
1264 · 'toplevel' / 'GTK_TOPLEVEL'
1265
1266 · 'no-window' / 'GTK_NO_WINDOW'
1267
1268 · 'realized' / 'GTK_REALIZED'
1269
1270 · 'mapped' / 'GTK_MAPPED'
1271
1272 · 'visible' / 'GTK_VISIBLE'
1273
1274 · 'sensitive' / 'GTK_SENSITIVE'
1275
1276 · 'parent-sensitive' / 'GTK_PARENT_SENSITIVE'
1277
1278 · 'can-focus' / 'GTK_CAN_FOCUS'
1279
1280 · 'has-focus' / 'GTK_HAS_FOCUS'
1281
1282 · 'can-default' / 'GTK_CAN_DEFAULT'
1283
1284 · 'has-default' / 'GTK_HAS_DEFAULT'
1285
1286 · 'has-grab' / 'GTK_HAS_GRAB'
1287
1288 · 'rc-style' / 'GTK_RC_STYLE'
1289
1290 · 'composite-child' / 'GTK_COMPOSITE_CHILD'
1291
1292 · 'no-reparent' / 'GTK_NO_REPARENT'
1293
1294 · 'app-paintable' / 'GTK_APP_PAINTABLE'
1295
1296 · 'receives-default' / 'GTK_RECEIVES_DEFAULT'
1297
1298 · 'double-buffered' / 'GTK_DOUBLE_BUFFERED'
1299
1300 · 'no-show-all' / 'GTK_NO_SHOW_ALL'
1301
1302 enum Gtk2::WidgetHelpType
1303 · 'tooltip' / 'GTK_WIDGET_HELP_TOOLTIP'
1304
1305 · 'whats-this' / 'GTK_WIDGET_HELP_WHATS_THIS'
1306
1308 Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object,
1309 Gtk2::TargetEntry
1310
1312 Copyright (C) 2003-2011 by the gtk2-perl team.
1313
1314 This software is licensed under the LGPL. See Gtk2 for a full notice.
1315
1316
1317
1318perl v5.32.0 2020-07-28 Gtk2::Widget(3)