.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Gtk2::Button 3" .TH Gtk2::Button 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Gtk2::Button \- wrapper for GtkButton .SH HIERARCHY .IX Header "HIERARCHY" .Vb 7 \& Glib::Object \& +\-\-\-\-Glib::InitiallyUnowned \& +\-\-\-\-Gtk2::Object \& +\-\-\-\-Gtk2::Widget \& +\-\-\-\-Gtk2::Container \& +\-\-\-\-Gtk2::Bin \& +\-\-\-\-Gtk2::Button .Ve .SH INTERFACES .IX Header "INTERFACES" .Vb 3 \& Glib::Object::_Unregistered::AtkImplementorIface \& Gtk2::Buildable \& Gtk2::Activatable .Ve .SH MNEMONICS .IX Header "MNEMONICS" Mnemonics are "memory aids"; in GTK+, a mnemonic is an underlined character which corresponds to a keyboard accelerator. For a button, that means pressing Alt and that key activates the button. .PP For convenience, Gtk2\-Perl uses mnemonics by default on widgets that support them. If characters in label string are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '_\|_' (two underscores). If you don't want to use mnemonics at all, use the non-mnemonic version explicitly (e.g. \f(CW\*(C`Gtk2::Button::new_with_label\*(C'\fR). .SH METHODS .IX Header "METHODS" .SS "widget = Gtk2::Button\->\fBnew\fP" .IX Subsection "widget = Gtk2::Button->new" .SS "widget = Gtk2::Button\->\fBnew\fP ($mnemonic)" .IX Subsection "widget = Gtk2::Button->new ($mnemonic)" .IP \(bu 4 \&\f(CW$mnemonic\fR (string) used to label the widget, see "MNEMONICS" .SS "widget = Gtk2::Button\->\fBnew_from_stock\fP ($stock_id)" .IX Subsection "widget = Gtk2::Button->new_from_stock ($stock_id)" .IP \(bu 4 \&\f(CW$stock_id\fR (string) creates a new button using the icon and text from the .PP specified stock item, see Gtk2::Stock .SS "widget = Gtk2::Button\->\fBnew_with_label\fP ($label)" .IX Subsection "widget = Gtk2::Button->new_with_label ($label)" .IP \(bu 4 \&\f(CW$label\fR (string) used to label the widget .SS "widget = Gtk2::Button\->\fBnew_with_mnemonic\fP ($mnemonic)" .IX Subsection "widget = Gtk2::Button->new_with_mnemonic ($mnemonic)" .IP \(bu 4 \&\f(CW$mnemonic\fR (string) used to label the widget, see "MNEMONICS" .ie n .SS "(xalign, yalign) = $button\->\fBget_alignment\fP" .el .SS "(xalign, yalign) = \f(CW$button\fP\->\fBget_alignment\fP" .IX Subsection "(xalign, yalign) = $button->get_alignment" Since: gtk+ 2.4 .ie n .SS "$button\->\fBset_alignment\fP ($xalign, $yalign)" .el .SS "\f(CW$button\fP\->\fBset_alignment\fP ($xalign, \f(CW$yalign\fP)" .IX Subsection "$button->set_alignment ($xalign, $yalign)" .IP \(bu 4 \&\f(CW$xalign\fR (double) .IP \(bu 4 \&\f(CW$yalign\fR (double) .PP Since: gtk+ 2.4 .ie n .SS $button\->\fBclicked\fP .el .SS \f(CW$button\fP\->\fBclicked\fP .IX Subsection "$button->clicked" .ie n .SS $button\->\fBenter\fP .el .SS \f(CW$button\fP\->\fBenter\fP .IX Subsection "$button->enter" .ie n .SS "window or undef = $button\->\fBget_event_window\fP" .el .SS "window or undef = \f(CW$button\fP\->\fBget_event_window\fP" .IX Subsection "window or undef = $button->get_event_window" Since: gtk+ 2.22 .ie n .SS "boolean = $button\->\fBget_focus_on_click\fP" .el .SS "boolean = \f(CW$button\fP\->\fBget_focus_on_click\fP" .IX Subsection "boolean = $button->get_focus_on_click" Since: gtk+ 2.4 .ie n .SS "$button\->\fBset_focus_on_click\fP ($focus_on_click)" .el .SS "\f(CW$button\fP\->\fBset_focus_on_click\fP ($focus_on_click)" .IX Subsection "$button->set_focus_on_click ($focus_on_click)" .IP \(bu 4 \&\f(CW$focus_on_click\fR (boolean) .PP Since: gtk+ 2.4 .ie n .SS "widget or undef = $button\->\fBget_image\fP" .el .SS "widget or undef = \f(CW$button\fP\->\fBget_image\fP" .IX Subsection "widget or undef = $button->get_image" Since: gtk+ 2.6 .ie n .SS "positiontype = $button\->\fBget_image_position\fP" .el .SS "positiontype = \f(CW$button\fP\->\fBget_image_position\fP" .IX Subsection "positiontype = $button->get_image_position" Since: gtk+ 2.10 .ie n .SS "$button\->\fBset_image_position\fP ($position)" .el .SS "\f(CW$button\fP\->\fBset_image_position\fP ($position)" .IX Subsection "$button->set_image_position ($position)" .IP \(bu 4 \&\f(CW$position\fR (Gtk2::PositionType) .PP Since: gtk+ 2.10 .ie n .SS "$button\->\fBset_image\fP ($image)" .el .SS "\f(CW$button\fP\->\fBset_image\fP ($image)" .IX Subsection "$button->set_image ($image)" .IP \(bu 4 \&\f(CW$image\fR (Gtk2::Widget or undef) .PP Since: gtk+ 2.6 .ie n .SS "string = $button\->\fBget_label\fP" .el .SS "string = \f(CW$button\fP\->\fBget_label\fP" .IX Subsection "string = $button->get_label" .ie n .SS "$button\->\fBset_label\fP ($label)" .el .SS "\f(CW$button\fP\->\fBset_label\fP ($label)" .IX Subsection "$button->set_label ($label)" .IP \(bu 4 \&\f(CW$label\fR (string) .ie n .SS $button\->\fBleave\fP .el .SS \f(CW$button\fP\->\fBleave\fP .IX Subsection "$button->leave" .ie n .SS $button\->\fBpressed\fP .el .SS \f(CW$button\fP\->\fBpressed\fP .IX Subsection "$button->pressed" .ie n .SS $button\->\fBreleased\fP .el .SS \f(CW$button\fP\->\fBreleased\fP .IX Subsection "$button->released" .ie n .SS "reliefstyle = $button\->\fBget_relief\fP" .el .SS "reliefstyle = \f(CW$button\fP\->\fBget_relief\fP" .IX Subsection "reliefstyle = $button->get_relief" .ie n .SS "$button\->\fBset_relief\fP ($newstyle)" .el .SS "\f(CW$button\fP\->\fBset_relief\fP ($newstyle)" .IX Subsection "$button->set_relief ($newstyle)" .IP \(bu 4 \&\f(CW$newstyle\fR (Gtk2::ReliefStyle) .ie n .SS "boolean = $button\->\fBget_use_stock\fP" .el .SS "boolean = \f(CW$button\fP\->\fBget_use_stock\fP" .IX Subsection "boolean = $button->get_use_stock" .ie n .SS "$button\->\fBset_use_stock\fP ($use_stock)" .el .SS "\f(CW$button\fP\->\fBset_use_stock\fP ($use_stock)" .IX Subsection "$button->set_use_stock ($use_stock)" .IP \(bu 4 \&\f(CW$use_stock\fR (boolean) .ie n .SS "boolean = $button\->\fBget_use_underline\fP" .el .SS "boolean = \f(CW$button\fP\->\fBget_use_underline\fP" .IX Subsection "boolean = $button->get_use_underline" .ie n .SS "$button\->\fBset_use_underline\fP ($use_underline)" .el .SS "\f(CW$button\fP\->\fBset_use_underline\fP ($use_underline)" .IX Subsection "$button->set_use_underline ($use_underline)" .IP \(bu 4 \&\f(CW$use_underline\fR (boolean) .SH PROPERTIES .IX Header "PROPERTIES" .IP "'focus\-on\-click' (boolean : default true : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'focus-on-click' (boolean : default true : readable / writable / private / static-nick / static-blurb)" Whether the button grabs focus when it is clicked with the mouse .IP "'image' (Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'image' (Gtk2::Widget : default undef : readable / writable / private / static-nick / static-blurb)" Child widget to appear next to the button text .IP "'image\-position' (Gtk2::PositionType : default ""left"" : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'image-position' (Gtk2::PositionType : default ""left"" : readable / writable / private / static-nick / static-blurb)" The position of the image relative to the text .IP "'label' (string : default undef : readable / writable / construct / private / static-nick / static-blurb)" 4 .IX Item "'label' (string : default undef : readable / writable / construct / private / static-nick / static-blurb)" Text of the label widget inside the button, if the button contains a label widget .IP "'relief' (Gtk2::ReliefStyle : default ""normal"" : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'relief' (Gtk2::ReliefStyle : default ""normal"" : readable / writable / private / static-nick / static-blurb)" The border relief style .IP "'use\-stock' (boolean : default false : readable / writable / construct / private / static-nick / static-blurb)" 4 .IX Item "'use-stock' (boolean : default false : readable / writable / construct / private / static-nick / static-blurb)" If set, the label is used to pick a stock item instead of being displayed .IP "'use\-underline' (boolean : default false : readable / writable / construct / private / static-nick / static-blurb)" 4 .IX Item "'use-underline' (boolean : default false : readable / writable / construct / private / static-nick / static-blurb)" If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key .IP "'xalign' (float : default 0.5 : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'xalign' (float : default 0.5 : readable / writable / private / static-nick / static-blurb)" Horizontal position of child in available space. 0.0 is left aligned, 1.0 is right aligned .IP "'yalign' (float : default 0.5 : readable / writable / private / static-nick / static-blurb)" 4 .IX Item "'yalign' (float : default 0.5 : readable / writable / private / static-nick / static-blurb)" Vertical position of child in available space. 0.0 is top aligned, 1.0 is bottom aligned .SH "STYLE PROPERTIES" .IX Header "STYLE PROPERTIES" .IP "'child\-displacement\-x' (integer : default 0 : readable / private / static-nick / static-blurb)" 4 .IX Item "'child-displacement-x' (integer : default 0 : readable / private / static-nick / static-blurb)" How far in the x direction to move the child when the button is depressed .IP "'child\-displacement\-y' (integer : default 0 : readable / private / static-nick / static-blurb)" 4 .IX Item "'child-displacement-y' (integer : default 0 : readable / private / static-nick / static-blurb)" How far in the y direction to move the child when the button is depressed .IP "'default\-border' (Gtk2::Border : default undef : readable / private / static-nick / static-blurb)" 4 .IX Item "'default-border' (Gtk2::Border : default undef : readable / private / static-nick / static-blurb)" Extra space to add for GTK_CAN_DEFAULT buttons .IP "'default\-outside\-border' (Gtk2::Border : default undef : readable / private / static-nick / static-blurb)" 4 .IX Item "'default-outside-border' (Gtk2::Border : default undef : readable / private / static-nick / static-blurb)" Extra space to add for GTK_CAN_DEFAULT buttons that is always drawn outside the border .IP "'displace\-focus' (boolean : default false : readable / private / static-nick / static-blurb)" 4 .IX Item "'displace-focus' (boolean : default false : readable / private / static-nick / static-blurb)" Whether the child_displacement_x/_y properties should also affect the focus rectangle .IP "'image\-spacing' (integer : default 2 : readable / private / static-nick / static-blurb)" 4 .IX Item "'image-spacing' (integer : default 2 : readable / private / static-nick / static-blurb)" Spacing in pixels between the image and label .IP "'inner\-border' (Gtk2::Border : default undef : readable / private / static-nick / static-blurb)" 4 .IX Item "'inner-border' (Gtk2::Border : default undef : readable / private / static-nick / static-blurb)" Border between button edges and child. .SH SIGNALS .IX Header "SIGNALS" .IP "\fBactivate\fR (Gtk2::Button)" 4 .IX Item "activate (Gtk2::Button)" .PD 0 .IP "\fBclicked\fR (Gtk2::Button)" 4 .IX Item "clicked (Gtk2::Button)" .IP "\fBenter\fR (Gtk2::Button)" 4 .IX Item "enter (Gtk2::Button)" .IP "\fBleave\fR (Gtk2::Button)" 4 .IX Item "leave (Gtk2::Button)" .IP "\fBpressed\fR (Gtk2::Button)" 4 .IX Item "pressed (Gtk2::Button)" .IP "\fBreleased\fR (Gtk2::Button)" 4 .IX Item "released (Gtk2::Button)" .PD .SH "ENUMS AND FLAGS" .IX Header "ENUMS AND FLAGS" .SS "enum Gtk2::PositionType" .IX Subsection "enum Gtk2::PositionType" .IP \(bu 4 \&'left' / 'GTK_POS_LEFT' .IP \(bu 4 \&'right' / 'GTK_POS_RIGHT' .IP \(bu 4 \&'top' / 'GTK_POS_TOP' .IP \(bu 4 \&'bottom' / 'GTK_POS_BOTTOM' .SS "enum Gtk2::ReliefStyle" .IX Subsection "enum Gtk2::ReliefStyle" .IP \(bu 4 \&'normal' / 'GTK_RELIEF_NORMAL' .IP \(bu 4 \&'half' / 'GTK_RELIEF_HALF' .IP \(bu 4 \&'none' / 'GTK_RELIEF_NONE' .SH "SEE ALSO" .IX Header "SEE ALSO" Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright (C) 2003\-2011 by the gtk2\-perl team. .PP This software is licensed under the LGPL. See Gtk2 for a full notice.