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)
823 Whether the application will paint directly on the widget
824
825 'can-default' (boolean : default false : readable / writable / private)
826 Whether the widget can be the default widget
827
828 'can-focus' (boolean : default false : readable / writable / private)
829 Whether the widget can accept the input focus
830
831 'composite-child' (boolean : default false : readable / private)
832 Whether the widget is part of a composite widget
833
834 'double-buffered' (boolean : default true : readable / writable /
835 private)
836 Whether or not the widget is double buffered
837
838 'events' (Gtk2::Gdk::EventMask : default structure-mask : readable /
839 writable / private)
840 The event mask that decides what kind of GdkEvents this widget gets
841
842 'extension-events' (Gtk2::Gdk::ExtensionMode : default "none" :
843 readable / writable / private)
844 The mask that decides what kind of extension events this widget
845 gets
846
847 'has-default' (boolean : default false : readable / writable / private)
848 Whether the widget is the default widget
849
850 'has-focus' (boolean : default false : readable / writable / private)
851 Whether the widget has the input focus
852
853 'has-tooltip' (boolean : default false : readable / writable / private)
854 Whether this widget has a tooltip
855
856 'height-request' (integer : default -1 : readable / writable / private)
857 Override for height request of the widget, or -1 if natural request
858 should be used
859
860 'is-focus' (boolean : default false : readable / writable / private)
861 Whether the widget is the focus widget within the toplevel
862
863 'name' (string : default undef : readable / writable / private)
864 The name of the widget
865
866 'no-show-all' (boolean : default false : readable / writable / private)
867 Whether gtk_widget_show_all() should not affect this widget
868
869 'parent' (Gtk2::Container : default undef : readable / writable /
870 private)
871 The parent widget of this widget. Must be a Container widget
872
873 'receives-default' (boolean : default false : readable / writable /
874 private)
875 If TRUE, the widget will receive the default action when it is
876 focused
877
878 'sensitive' (boolean : default true : readable / writable / private)
879 Whether the widget responds to input
880
881 'style' (Gtk2::Style : default undef : readable / writable / private)
882 The style of the widget, which contains information about how it
883 will look (colors etc)
884
885 'tooltip-markup' (string : default undef : readable / writable /
886 private)
887 The contents of the tooltip for this widget
888
889 'tooltip-text' (string : default undef : readable / writable / private)
890 The contents of the tooltip for this widget
891
892 'visible' (boolean : default false : readable / writable / private)
893 Whether the widget is visible
894
895 'width-request' (integer : default -1 : readable / writable / private)
896 Override for width request of the widget, or -1 if natural request
897 should be used
898
899 'window' (Gtk2::Gdk::Window : default undef : readable / private)
900 The widget's window if it is realized
901
903 'cursor-aspect-ratio' (float : default 0.04 : readable / private)
904 Aspect ratio with which to draw insertion cursor
905
906 'cursor-color' (Gtk2::Gdk::Color : default undef : readable / private)
907 Color with which to draw insertion cursor
908
909 'draw-border' (Gtk2::Border : default undef : readable / private)
910 Size of areas outside the widget's allocation to draw
911
912 'focus-line-pattern' (string : default "\1\1" : readable / private)
913 Dash pattern used to draw the focus indicator
914
915 'focus-line-width' (integer : default 1 : readable / private)
916 Width, in pixels, of the focus indicator line
917
918 'focus-padding' (integer : default 1 : readable / private)
919 Width, in pixels, between focus indicator and the widget 'box'
920
921 'interior-focus' (boolean : default true : readable / private)
922 Whether to draw the focus indicator inside widgets
923
924 'link-color' (Gtk2::Gdk::Color : default undef : readable / private)
925 Color of unvisited links
926
927 'scroll-arrow-hlength' (integer : default 16 : readable / private)
928 The length of horizontal scroll arrows
929
930 'scroll-arrow-vlength' (integer : default 16 : readable / private)
931 The length of vertical scroll arrows
932
933 'secondary-cursor-color' (Gtk2::Gdk::Color : default undef : readable /
934 private)
935 Color with which to draw the secondary insertion cursor when
936 editing mixed right-to-left and left-to-right text
937
938 'separator-height' (integer : default 0 : readable / private)
939 The height of separators if "wide-separators" is TRUE
940
941 'separator-width' (integer : default 0 : readable / private)
942 The width of separators if wide-separators is TRUE
943
944 'tooltip-alpha' (Glib::UChar : default 255 : readable / private)
945 The opacity to be used when drawing tooltips
946
947 'tooltip-radius' (Glib::UInt : default 0 : readable / private)
948 The radius to be used when drawing tooltips
949
950 'visited-link-color' (Gtk2::Gdk::Color : default undef : readable /
951 private)
952 Color of visited links
953
954 'wide-separators' (boolean : default false : readable / private)
955 Whether separators have configurable width and should be drawn
956 using a box instead of a line
957
958 'window-dragging' (boolean : default false : readable / writable /
959 private)
960 Window dragging
961
963 accel-closures-changed (Gtk2::Widget)
964 boolean = button-press-event (Gtk2::Widget, Gtk2::Gdk::Event)
965 boolean = button-release-event (Gtk2::Widget, Gtk2::Gdk::Event)
966 boolean = can-activate-accel (Gtk2::Widget, Glib::UInt)
967 child-notify (Gtk2::Widget, Glib::ParamSpec)
968 boolean = client-event (Gtk2::Widget, Gtk2::Gdk::Event)
969 composited-changed (Gtk2::Widget)
970 boolean = configure-event (Gtk2::Widget, Gtk2::Gdk::Event)
971 boolean = damage-event (Gtk2::Widget, Gtk2::Gdk::Event)
972 boolean = delete-event (Gtk2::Widget, Gtk2::Gdk::Event)
973 boolean = destroy-event (Gtk2::Widget, Gtk2::Gdk::Event)
974 direction-changed (Gtk2::Widget, Gtk2::TextDirection)
975 drag-begin (Gtk2::Widget, Gtk2::Gdk::DragContext)
976 drag-data-delete (Gtk2::Widget, Gtk2::Gdk::DragContext)
977 drag-data-get (Gtk2::Widget, Gtk2::Gdk::DragContext,
978 Gtk2::SelectionData, Glib::UInt, Glib::UInt)
979 drag-data-received (Gtk2::Widget, Gtk2::Gdk::DragContext, integer,
980 integer, Gtk2::SelectionData, Glib::UInt, Glib::UInt)
981 boolean = drag-drop (Gtk2::Widget, Gtk2::Gdk::DragContext, integer,
982 integer, Glib::UInt)
983 drag-end (Gtk2::Widget, Gtk2::Gdk::DragContext)
984 boolean = drag-failed (Gtk2::Widget, Gtk2::Gdk::DragContext,
985 Gtk2::DragResult)
986 drag-leave (Gtk2::Widget, Gtk2::Gdk::DragContext, Glib::UInt)
987 boolean = drag-motion (Gtk2::Widget, Gtk2::Gdk::DragContext, integer,
988 integer, Glib::UInt)
989 boolean = enter-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
990 boolean = event (Gtk2::Widget, Gtk2::Gdk::Event)
991 event-after (Gtk2::Widget, Gtk2::Gdk::Event)
992 boolean = expose-event (Gtk2::Widget, Gtk2::Gdk::Event)
993 boolean = focus (Gtk2::Widget, Gtk2::DirectionType)
994 boolean = focus-in-event (Gtk2::Widget, Gtk2::Gdk::Event)
995 boolean = focus-out-event (Gtk2::Widget, Gtk2::Gdk::Event)
996 boolean = grab-broken-event (Gtk2::Widget, Gtk2::Gdk::Event)
997 grab-focus (Gtk2::Widget)
998 grab-notify (Gtk2::Widget, boolean)
999 hide (Gtk2::Widget)
1000 hierarchy-changed (Gtk2::Widget, Gtk2::Widget)
1001 boolean = key-press-event (Gtk2::Widget, Gtk2::Gdk::Event)
1002 boolean = key-release-event (Gtk2::Widget, Gtk2::Gdk::Event)
1003 boolean = keynav-failed (Gtk2::Widget, Gtk2::DirectionType)
1004 boolean = leave-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1005 map (Gtk2::Widget)
1006 boolean = map-event (Gtk2::Widget, Gtk2::Gdk::Event)
1007 boolean = mnemonic-activate (Gtk2::Widget, boolean)
1008 boolean = motion-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1009 move-focus (Gtk2::Widget, Gtk2::DirectionType)
1010 boolean = no-expose-event (Gtk2::Widget, Gtk2::Gdk::Event)
1011 parent-set (Gtk2::Widget, Gtk2::Widget)
1012 boolean = popup-menu (Gtk2::Widget)
1013 boolean = property-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1014 boolean = proximity-in-event (Gtk2::Widget, Gtk2::Gdk::Event)
1015 boolean = proximity-out-event (Gtk2::Widget, Gtk2::Gdk::Event)
1016 boolean = query-tooltip (Gtk2::Widget, integer, integer, boolean,
1017 Gtk2::Tooltip)
1018 realize (Gtk2::Widget)
1019 screen-changed (Gtk2::Widget, Gtk2::Gdk::Screen)
1020 boolean = scroll-event (Gtk2::Widget, Gtk2::Gdk::Event)
1021 boolean = selection-clear-event (Gtk2::Widget, Gtk2::Gdk::Event)
1022 selection-get (Gtk2::Widget, Gtk2::SelectionData, Glib::UInt,
1023 Glib::UInt)
1024 boolean = selection-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1025 selection-received (Gtk2::Widget, Gtk2::SelectionData, Glib::UInt)
1026 boolean = selection-request-event (Gtk2::Widget, Gtk2::Gdk::Event)
1027 show (Gtk2::Widget)
1028 boolean = show-help (Gtk2::Widget, Gtk2::WidgetHelpType)
1029 size-allocate (Gtk2::Widget, Gtk2::Gdk::Rectangle)
1030 size-request (Gtk2::Widget, Gtk2::Requisition)
1031 state-changed (Gtk2::Widget, Gtk2::StateType)
1032 style-set (Gtk2::Widget, Gtk2::Style)
1033 unmap (Gtk2::Widget)
1034 boolean = unmap-event (Gtk2::Widget, Gtk2::Gdk::Event)
1035 unrealize (Gtk2::Widget)
1036 boolean = visibility-notify-event (Gtk2::Widget, Gtk2::Gdk::Event)
1037 boolean = window-state-event (Gtk2::Widget, Gtk2::Gdk::Event)
1038
1040 flags Gtk2::AccelFlags
1041 · 'visible' / 'GTK_ACCEL_VISIBLE'
1042
1043 · 'locked' / 'GTK_ACCEL_LOCKED'
1044
1045 · 'mask' / 'GTK_ACCEL_MASK'
1046
1047 flags Gtk2::DestDefaults
1048 · 'motion' / 'GTK_DEST_DEFAULT_MOTION'
1049
1050 · 'highlight' / 'GTK_DEST_DEFAULT_HIGHLIGHT'
1051
1052 · 'drop' / 'GTK_DEST_DEFAULT_DROP'
1053
1054 · 'all' / 'GTK_DEST_DEFAULT_ALL'
1055
1056 enum Gtk2::DirectionType
1057 · 'tab-forward' / 'GTK_DIR_TAB_FORWARD'
1058
1059 · 'tab-backward' / 'GTK_DIR_TAB_BACKWARD'
1060
1061 · 'up' / 'GTK_DIR_UP'
1062
1063 · 'down' / 'GTK_DIR_DOWN'
1064
1065 · 'left' / 'GTK_DIR_LEFT'
1066
1067 · 'right' / 'GTK_DIR_RIGHT'
1068
1069 enum Gtk2::DragResult
1070 · 'success' / 'GTK_DRAG_RESULT_SUCCESS'
1071
1072 · 'no-target' / 'GTK_DRAG_RESULT_NO_TARGET'
1073
1074 · 'user-cancelled' / 'GTK_DRAG_RESULT_USER_CANCELLED'
1075
1076 · 'timeout-expired' / 'GTK_DRAG_RESULT_TIMEOUT_EXPIRED'
1077
1078 · 'grab-broken' / 'GTK_DRAG_RESULT_GRAB_BROKEN'
1079
1080 · 'error' / 'GTK_DRAG_RESULT_ERROR'
1081
1082 flags Gtk2::Gdk::DragAction
1083 · 'default' / 'GDK_ACTION_DEFAULT'
1084
1085 · 'copy' / 'GDK_ACTION_COPY'
1086
1087 · 'move' / 'GDK_ACTION_MOVE'
1088
1089 · 'link' / 'GDK_ACTION_LINK'
1090
1091 · 'private' / 'GDK_ACTION_PRIVATE'
1092
1093 · 'ask' / 'GDK_ACTION_ASK'
1094
1095 enum Gtk2::Gdk::DragProtocol
1096 · 'motif' / 'GDK_DRAG_PROTO_MOTIF'
1097
1098 · 'xdnd' / 'GDK_DRAG_PROTO_XDND'
1099
1100 · 'rootwin' / 'GDK_DRAG_PROTO_ROOTWIN'
1101
1102 · 'none' / 'GDK_DRAG_PROTO_NONE'
1103
1104 · 'win32-dropfiles' / 'GDK_DRAG_PROTO_WIN32_DROPFILES'
1105
1106 · 'ole2' / 'GDK_DRAG_PROTO_OLE2'
1107
1108 · 'local' / 'GDK_DRAG_PROTO_LOCAL'
1109
1110 flags Gtk2::Gdk::EventMask
1111 · 'exposure-mask' / 'GDK_EXPOSURE_MASK'
1112
1113 · 'pointer-motion-mask' / 'GDK_POINTER_MOTION_MASK'
1114
1115 · 'pointer-motion-hint-mask' / 'GDK_POINTER_MOTION_HINT_MASK'
1116
1117 · 'button-motion-mask' / 'GDK_BUTTON_MOTION_MASK'
1118
1119 · 'button1-motion-mask' / 'GDK_BUTTON1_MOTION_MASK'
1120
1121 · 'button2-motion-mask' / 'GDK_BUTTON2_MOTION_MASK'
1122
1123 · 'button3-motion-mask' / 'GDK_BUTTON3_MOTION_MASK'
1124
1125 · 'button-press-mask' / 'GDK_BUTTON_PRESS_MASK'
1126
1127 · 'button-release-mask' / 'GDK_BUTTON_RELEASE_MASK'
1128
1129 · 'key-press-mask' / 'GDK_KEY_PRESS_MASK'
1130
1131 · 'key-release-mask' / 'GDK_KEY_RELEASE_MASK'
1132
1133 · 'enter-notify-mask' / 'GDK_ENTER_NOTIFY_MASK'
1134
1135 · 'leave-notify-mask' / 'GDK_LEAVE_NOTIFY_MASK'
1136
1137 · 'focus-change-mask' / 'GDK_FOCUS_CHANGE_MASK'
1138
1139 · 'structure-mask' / 'GDK_STRUCTURE_MASK'
1140
1141 · 'property-change-mask' / 'GDK_PROPERTY_CHANGE_MASK'
1142
1143 · 'visibility-notify-mask' / 'GDK_VISIBILITY_NOTIFY_MASK'
1144
1145 · 'proximity-in-mask' / 'GDK_PROXIMITY_IN_MASK'
1146
1147 · 'proximity-out-mask' / 'GDK_PROXIMITY_OUT_MASK'
1148
1149 · 'substructure-mask' / 'GDK_SUBSTRUCTURE_MASK'
1150
1151 · 'scroll-mask' / 'GDK_SCROLL_MASK'
1152
1153 · 'all-events-mask' / 'GDK_ALL_EVENTS_MASK'
1154
1155 enum Gtk2::Gdk::ExtensionMode
1156 · 'none' / 'GDK_EXTENSION_EVENTS_NONE'
1157
1158 · 'all' / 'GDK_EXTENSION_EVENTS_ALL'
1159
1160 · 'cursor' / 'GDK_EXTENSION_EVENTS_CURSOR'
1161
1162 flags Gtk2::Gdk::ModifierType
1163 · 'shift-mask' / 'GDK_SHIFT_MASK'
1164
1165 · 'lock-mask' / 'GDK_LOCK_MASK'
1166
1167 · 'control-mask' / 'GDK_CONTROL_MASK'
1168
1169 · 'mod1-mask' / 'GDK_MOD1_MASK'
1170
1171 · 'mod2-mask' / 'GDK_MOD2_MASK'
1172
1173 · 'mod3-mask' / 'GDK_MOD3_MASK'
1174
1175 · 'mod4-mask' / 'GDK_MOD4_MASK'
1176
1177 · 'mod5-mask' / 'GDK_MOD5_MASK'
1178
1179 · 'button1-mask' / 'GDK_BUTTON1_MASK'
1180
1181 · 'button2-mask' / 'GDK_BUTTON2_MASK'
1182
1183 · 'button3-mask' / 'GDK_BUTTON3_MASK'
1184
1185 · 'button4-mask' / 'GDK_BUTTON4_MASK'
1186
1187 · 'button5-mask' / 'GDK_BUTTON5_MASK'
1188
1189 · 'super-mask' / 'GDK_SUPER_MASK'
1190
1191 · 'hyper-mask' / 'GDK_HYPER_MASK'
1192
1193 · 'meta-mask' / 'GDK_META_MASK'
1194
1195 · 'release-mask' / 'GDK_RELEASE_MASK'
1196
1197 · 'modifier-mask' / 'GDK_MODIFIER_MASK'
1198
1199 enum Gtk2::IconSize
1200 · 'invalid' / 'GTK_ICON_SIZE_INVALID'
1201
1202 · 'menu' / 'GTK_ICON_SIZE_MENU'
1203
1204 · 'small-toolbar' / 'GTK_ICON_SIZE_SMALL_TOOLBAR'
1205
1206 · 'large-toolbar' / 'GTK_ICON_SIZE_LARGE_TOOLBAR'
1207
1208 · 'button' / 'GTK_ICON_SIZE_BUTTON'
1209
1210 · 'dnd' / 'GTK_ICON_SIZE_DND'
1211
1212 · 'dialog' / 'GTK_ICON_SIZE_DIALOG'
1213
1214 enum Gtk2::StateType
1215 · 'normal' / 'GTK_STATE_NORMAL'
1216
1217 · 'active' / 'GTK_STATE_ACTIVE'
1218
1219 · 'prelight' / 'GTK_STATE_PRELIGHT'
1220
1221 · 'selected' / 'GTK_STATE_SELECTED'
1222
1223 · 'insensitive' / 'GTK_STATE_INSENSITIVE'
1224
1225 enum Gtk2::TextDirection
1226 · 'none' / 'GTK_TEXT_DIR_NONE'
1227
1228 · 'ltr' / 'GTK_TEXT_DIR_LTR'
1229
1230 · 'rtl' / 'GTK_TEXT_DIR_RTL'
1231
1232 flags Gtk2::WidgetFlags
1233 · 'toplevel' / 'GTK_TOPLEVEL'
1234
1235 · 'no-window' / 'GTK_NO_WINDOW'
1236
1237 · 'realized' / 'GTK_REALIZED'
1238
1239 · 'mapped' / 'GTK_MAPPED'
1240
1241 · 'visible' / 'GTK_VISIBLE'
1242
1243 · 'sensitive' / 'GTK_SENSITIVE'
1244
1245 · 'parent-sensitive' / 'GTK_PARENT_SENSITIVE'
1246
1247 · 'can-focus' / 'GTK_CAN_FOCUS'
1248
1249 · 'has-focus' / 'GTK_HAS_FOCUS'
1250
1251 · 'can-default' / 'GTK_CAN_DEFAULT'
1252
1253 · 'has-default' / 'GTK_HAS_DEFAULT'
1254
1255 · 'has-grab' / 'GTK_HAS_GRAB'
1256
1257 · 'rc-style' / 'GTK_RC_STYLE'
1258
1259 · 'composite-child' / 'GTK_COMPOSITE_CHILD'
1260
1261 · 'no-reparent' / 'GTK_NO_REPARENT'
1262
1263 · 'app-paintable' / 'GTK_APP_PAINTABLE'
1264
1265 · 'receives-default' / 'GTK_RECEIVES_DEFAULT'
1266
1267 · 'double-buffered' / 'GTK_DOUBLE_BUFFERED'
1268
1269 · 'no-show-all' / 'GTK_NO_SHOW_ALL'
1270
1271 enum Gtk2::WidgetHelpType
1272 · 'tooltip' / 'GTK_WIDGET_HELP_TOOLTIP'
1273
1274 · 'whats-this' / 'GTK_WIDGET_HELP_WHATS_THIS'
1275
1277 Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object,
1278 Gtk2::TargetEntry
1279
1281 Copyright (C) 2003-2011 by the gtk2-perl team.
1282
1283 This software is licensed under the LGPL. See Gtk2 for a full notice.
1284
1285
1286
1287perl v5.28.1 2019-02-02 Gtk2::Widget(3)