.\" -*- 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 "Gtk3 3" .TH Gtk3 3 2024-07-13 "perl v5.38.2" "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 Gtk3 \- Perl interface to the 3.x series of the gtk+ toolkit .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 7 \& use Gtk3 \-init; \& my $window = Gtk3::Window\->new (\*(Aqtoplevel\*(Aq); \& my $button = Gtk3::Button\->new (\*(AqQuit\*(Aq); \& $button\->signal_connect (clicked => sub { Gtk3::main_quit }); \& $window\->add ($button); \& $window\->show_all; \& Gtk3::main; .Ve .SH ABSTRACT .IX Header "ABSTRACT" Perl bindings to the 3.x series of the gtk+ toolkit. This module allows you to write graphical user interfaces in a Perlish and object-oriented way, freeing you from the casting and memory management in C, yet remaining very close in spirit to original API. .SH DESCRIPTION .IX Header "DESCRIPTION" The \f(CW\*(C`Gtk3\*(C'\fR module allows a Perl developer to use the gtk+ graphical user interface library. Find out more about gtk+ at . .PP The gtk+ reference manual is also a handy companion when writing \f(CW\*(C`Gtk3\*(C'\fR programs in Perl: . The Perl bindings follow the C API very closely, and the C reference documentation should be considered the canonical source. The principles underlying the mapping from C to Perl are explained in the documentation of Glib::Object::Introspection, on which \f(CW\*(C`Gtk3\*(C'\fR is based. .PP Glib::Object::Introspection also comes with the \f(CW\*(C`perli11ndoc\*(C'\fR program which displays the API reference documentation of all installed libraries organized in accordance with these principles. .SS "Wrapped libraries" .IX Subsection "Wrapped libraries" \&\f(CW\*(C`Gtk3\*(C'\fR automatically sets up the following correspondence between C libraries and Perl packages: .PP .Vb 7 \& Library | Package \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\- \& Gtk\-3.0 | Gtk3 \& Gdk\-3.0 | Gtk3::Gdk \& GdkPixbuf\-2.0 | Gtk3::Gdk \& GdkPixdata\-2.0| Gtk3::Gdk \& Pango\-1.0 | Pango .Ve .SS "Import arguments" .IX Subsection "Import arguments" When importing \f(CW\*(C`Gtk3\*(C'\fR, you can pass \f(CW\*(C`\-init\*(C'\fR as in \f(CW\*(C`use Gtk3 \-init;\*(C'\fR to have \f(CW\*(C`Gtk3::init\*(C'\fR automatically called. You can also pass a version number to require a certain version of \f(CW\*(C`Gtk3\*(C'\fR. .SS "Customizations and overrides" .IX Subsection "Customizations and overrides" In order to make things more Perlish or to make porting from \f(CW\*(C`Gtk2\*(C'\fR to \f(CW\*(C`Gtk3\*(C'\fR easier, \f(CW\*(C`Gtk3\*(C'\fR customizes the API generated by Glib::Object::Introspection in a few spots: .IP \(bu 4 The array ref normally returned by the following functions is flattened into a list: .RS 4 .IP Gtk3::ActionGroup::list_actions 4 .IX Item "Gtk3::ActionGroup::list_actions" .PD 0 .IP Gtk3::Builder::get_objects 4 .IX Item "Gtk3::Builder::get_objects" .IP Gtk3::CellLayout::get_cells 4 .IX Item "Gtk3::CellLayout::get_cells" .IP Gtk3::Container::get_children 4 .IX Item "Gtk3::Container::get_children" .IP Gtk3::SizeGroup::get_widgets 4 .IX Item "Gtk3::SizeGroup::get_widgets" .IP Gtk3::TreePath::get_indices 4 .IX Item "Gtk3::TreePath::get_indices" .IP Gtk3::TreeView::get_columns 4 .IX Item "Gtk3::TreeView::get_columns" .IP Gtk3::UIManager::get_action_groups 4 .IX Item "Gtk3::UIManager::get_action_groups" .IP Gtk3::UIManager::get_toplevels 4 .IX Item "Gtk3::UIManager::get_toplevels" .IP Gtk3::Window::list_toplevels 4 .IX Item "Gtk3::Window::list_toplevels" .IP Gtk3::stock_list_ids 4 .IX Item "Gtk3::stock_list_ids" .IP Gtk3::Gdk::Pixbuf::get_formats 4 .IX Item "Gtk3::Gdk::Pixbuf::get_formats" .RE .RS 4 .RE .IP \(bu 4 .PD The following functions normally return a boolean and additional out arguments, where the boolean indicates whether the out arguments are valid. They are altered such that when the boolean is true, only the additional out arguments are returned, and when the boolean is false, an empty list is returned. .RS 4 .IP Gtk3::TextBuffer::get_selection_bounds 4 .IX Item "Gtk3::TextBuffer::get_selection_bounds" .PD 0 .IP Gtk3::TreeModel::get_iter 4 .IX Item "Gtk3::TreeModel::get_iter" .IP Gtk3::TreeModel::get_iter_first 4 .IX Item "Gtk3::TreeModel::get_iter_first" .IP Gtk3::TreeModel::get_iter_from_string 4 .IX Item "Gtk3::TreeModel::get_iter_from_string" .IP Gtk3::TreeModel::iter_children 4 .IX Item "Gtk3::TreeModel::iter_children" .IP Gtk3::TreeModel::iter_nth_child 4 .IX Item "Gtk3::TreeModel::iter_nth_child" .IP Gtk3::TreeModel::iter_parent 4 .IX Item "Gtk3::TreeModel::iter_parent" .IP Gtk3::TreeModelFilter::convert_child_iter_to_iter 4 .IX Item "Gtk3::TreeModelFilter::convert_child_iter_to_iter" .IP Gtk3::TreeModelSort::convert_child_iter_to_iter 4 .IX Item "Gtk3::TreeModelSort::convert_child_iter_to_iter" .IP Gtk3::TreeSelection::get_selected 4 .IX Item "Gtk3::TreeSelection::get_selected" .IP Gtk3::TreeView::get_dest_row_at_pos 4 .IX Item "Gtk3::TreeView::get_dest_row_at_pos" .IP Gtk3::TreeView::get_path_at_pos 4 .IX Item "Gtk3::TreeView::get_path_at_pos" .IP Gtk3::TreeView::get_tooltip_context 4 .IX Item "Gtk3::TreeView::get_tooltip_context" .IP Gtk3::TreeView::get_visible_range 4 .IX Item "Gtk3::TreeView::get_visible_range" .IP Gtk3::TreeViewColumn::cell_get_position 4 .IX Item "Gtk3::TreeViewColumn::cell_get_position" .IP Gtk3::stock_lookup 4 .IX Item "Gtk3::stock_lookup" .IP Gtk3::Gdk::Event::get_axis 4 .IX Item "Gtk3::Gdk::Event::get_axis" .IP Gtk3::Gdk::Event::get_button 4 .IX Item "Gtk3::Gdk::Event::get_button" .IP Gtk3::Gdk::Event::get_click_count 4 .IX Item "Gtk3::Gdk::Event::get_click_count" .IP Gtk3::Gdk::Event::get_coords 4 .IX Item "Gtk3::Gdk::Event::get_coords" .IP Gtk3::Gdk::Event::get_keycode 4 .IX Item "Gtk3::Gdk::Event::get_keycode" .IP Gtk3::Gdk::Event::get_keyval 4 .IX Item "Gtk3::Gdk::Event::get_keyval" .IP Gtk3::Gdk::Event::get_scroll_direction 4 .IX Item "Gtk3::Gdk::Event::get_scroll_direction" .IP Gtk3::Gdk::Event::get_scroll_deltas 4 .IX Item "Gtk3::Gdk::Event::get_scroll_deltas" .IP Gtk3::Gdk::Event::get_state 4 .IX Item "Gtk3::Gdk::Event::get_state" .IP Gtk3::Gdk::Event::get_root_coords 4 .IX Item "Gtk3::Gdk::Event::get_root_coords" .IP Gtk3::Gdk::Window::get_origin 4 .IX Item "Gtk3::Gdk::Window::get_origin" .RE .RS 4 .RE .IP \(bu 4 .PD Values of type Gtk3::ResponseType are converted to and from nick names if possible, while still allowing raw IDs, in the following places: .RS 4 .ie n .IP "\- For Gtk3::Dialog and Gtk3::InfoBar: the signal ""response"" as well as the methods ""add_action_widget"", ""add_button"", ""add_buttons"", ""response"", ""set_default_response"" and ""set_response_sensitive""." 4 .el .IP "\- For Gtk3::Dialog and Gtk3::InfoBar: the signal \f(CWresponse\fR as well as the methods \f(CWadd_action_widget\fR, \f(CWadd_button\fR, \f(CWadd_buttons\fR, \f(CWresponse\fR, \f(CWset_default_response\fR and \f(CWset_response_sensitive\fR." 4 .IX Item "- For Gtk3::Dialog and Gtk3::InfoBar: the signal response as well as the methods add_action_widget, add_button, add_buttons, response, set_default_response and set_response_sensitive." .PD 0 .ie n .IP "\- For Gtk3::Dialog: the methods ""get_response_for_widget"", ""get_widget_for_response"", ""run"" and ""set_alternative_button_order""." 4 .el .IP "\- For Gtk3::Dialog: the methods \f(CWget_response_for_widget\fR, \f(CWget_widget_for_response\fR, \f(CWrun\fR and \f(CWset_alternative_button_order\fR." 4 .IX Item "- For Gtk3::Dialog: the methods get_response_for_widget, get_widget_for_response, run and set_alternative_button_order." .RE .RS 4 .RE .IP \(bu 4 .PD Values of type Gtk3::IconSize are converted to and from nick names if possible, while still allowing raw IDs, in the following places: .RS 4 .IP "\- Gtk3::Image: the constructors new_from_stock, new_from_icon_set, new_from_icon_name and new_from_gicon, the getters get_stock, get_icon_set, get_icon_name and get_gicon and the setters set_from_stock, set_from_icon_set, set_from_icon_name, set_from_gicon." 4 .IX Item "- Gtk3::Image: the constructors new_from_stock, new_from_icon_set, new_from_icon_name and new_from_gicon, the getters get_stock, get_icon_set, get_icon_name and get_gicon and the setters set_from_stock, set_from_icon_set, set_from_icon_name, set_from_gicon." .PD 0 .IP "\- Gtk3::Widget: the method render_icon." 4 .IX Item "- Gtk3::Widget: the method render_icon." .RE .RS 4 .RE .IP \(bu 4 .PD The constants \f(CW\*(C`Gtk3::EVENT_PROPAGATE\*(C'\fR and \f(CW\*(C`Gtk3::EVENT_STOP\*(C'\fR can be used in handlers for event signals like \f(CW\*(C`key\-press\-event\*(C'\fR to indicate whether or not the event should continue propagating through the widget hierarchy. .IP \(bu 4 The records corresponding to the various Gtk3::Gdk::Event types, like \&\f(CW\*(C`expose\*(C'\fR or \f(CW\*(C`key\-release\*(C'\fR, are represented as objects blessed into specific Perl packages, like \f(CW\*(C`Gtk3::Gdk::EventExpose\*(C'\fR or \f(CW\*(C`Gtk3::Gdk::EventKey\*(C'\fR, that all inherit from \f(CW\*(C`Gtk3::Gdk::Event\*(C'\fR. This allows you to seemlessly access type-specific fields as well as common fields, as in \f(CW\*(C`$event\->window\*(C'\fR or \&\f(CW\*(C`$event\->keyval\*(C'\fR. .IP \(bu 4 Gtk3::Gdk::Atom has overloads for the \f(CW\*(C`==\*(C'\fR and \f(CW\*(C`!=\*(C'\fR operators that check for equality of the underlying atoms. .IP \(bu 4 For backwards compatibility, the functions \f(CW\*(C`Gtk3::get_version_info\*(C'\fR and \f(CW\*(C`Gtk3::GET_VERSION_INFO\*(C'\fR are provided, and the functions \&\f(CW\*(C`Gtk3::CHECK_VERSION\*(C'\fR, \f(CW\*(C`Gtk3::check_version\*(C'\fR, \f(CW\*(C`Gtk3::init\*(C'\fR, \&\f(CW\*(C`Gtk3::init_check\*(C'\fR, \f(CW\*(C`Gtk3::main\*(C'\fR, \f(CW\*(C`Gtk3::main_level\*(C'\fR and \f(CW\*(C`Gtk3::main_quit\*(C'\fR can be called as class-static or as normal functions: for example, \f(CW\*(C`Gtk3\->main_quit\*(C'\fR and \f(CW\*(C`Gtk3::main_quit\*(C'\fR are both supported. Additionally, \f(CW\*(C`Gtk3::init\*(C'\fR and \f(CW\*(C`Gtk3::init_check\*(C'\fR automatically handle passing and updating \f(CW@ARGV\fR as appropriate. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::show_about_dialog\*(C'\fR is provided. .IP \(bu 4 Perl reimplementations of \f(CW\*(C`Gtk3::ActionGroup::add_actions\*(C'\fR, \&\f(CW\*(C`add_radio_actions\*(C'\fR and \f(CW\*(C`add_toggle_actions\*(C'\fR are provided. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Builder::add_objects_from_file\*(C'\fR and \f(CW\*(C`add_objects_from_string\*(C'\fR also accept a list of objects instead of an array ref. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Builder::add_objects_from_string\*(C'\fR and \f(CW\*(C`add_from_string\*(C'\fR don't take length arguments, as they are computed automatically. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::Builder::connect_signals\*(C'\fR is provided. .IP \(bu 4 The default \f(CW\*(C`new\*(C'\fR constructors of Gtk3::Button, Gtk3::CheckButton, Gtk3::ColorButton, Gtk3::FontButton and Gtk3::ToggleButton reroute to \&\f(CW\*(C`new_with_mnemonic\*(C'\fR if given an extra argument. .IP \(bu 4 The default \f(CW\*(C`new\*(C'\fR constructor of Gtk3::CheckMenuItem reroutes to \&\f(CW\*(C`new_with_mnemonic\*(C'\fR if given an extra argument. .IP \(bu 4 The \f(CW\*(C`length\*(C'\fR argument of \f(CW\*(C`Gtk3::Clipboard::set_text\*(C'\fR is optional. .IP \(bu 4 Perl reimplementations of \f(CW\*(C`Gtk3::Container::add_with_properties\*(C'\fR, \&\f(CW\*(C`Gtk3::Container::child_get\*(C'\fR and \f(CW\*(C`Gtk3::Container::child_set\*(C'\fR are provided. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Container::find_child_property\*(C'\fR and \&\f(CW\*(C`Gtk3::Container::list_child_properties\*(C'\fR are forwarded to the corresponding functions in \f(CW\*(C`Gtk3::ContainerClass\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Container::get_focus_chain\*(C'\fR returns a list of widgets, or an empty list. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Container::set_focus_chain\*(C'\fR also accepts a list of widgets. .IP \(bu 4 \&\f(CW\*(C`Gtk3::CssProvider::load_from_data\*(C'\fR also accepts a string. .IP \(bu 4 For Gtk3::Dialog and Gtk3::InfoBar, a Perl implementation of \&\f(CW\*(C`add_buttons\*(C'\fR is provided. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Dialog::new\*(C'\fR can optionally be called as \f(CW\*(C`Gtk3::Dialog\->new (TITLE, PARENT, FLAGS, ...)\*(C'\fR where \f(CW\*(C`...\*(C'\fR is a series of button text and response id pairs. .IP \(bu 4 A Perl implementation of \f(CW\*(C`Gtk3::Dialog::new_with_buttons\*(C'\fR is provided. .IP \(bu 4 The \f(CW\*(C`length\*(C'\fR argument of \f(CW\*(C`Gtk3::Editable::insert_text\*(C'\fR is optional. .IP \(bu 4 A Perl implementation of \f(CW\*(C`Gtk3::FileChooserDialog::new\*(C'\fR is provided. .IP \(bu 4 \&\f(CW\*(C`Gtk3::HBox::new\*(C'\fR uses the defaults homogeneous = FALSE and spacing = 5. .IP \(bu 4 The default \f(CW\*(C`new\*(C'\fR constructor of Gtk3::ImageMenuItem reroutes to \&\f(CW\*(C`new_with_mnemonic\*(C'\fR if given an extra argument. .IP \(bu 4 \&\f(CW\*(C`Gtk3::InfoBar::new\*(C'\fR can optionally be called as \f(CW\*(C`Gtk3::InfoBar\->new (...)\*(C'\fR where \f(CW\*(C`...\*(C'\fR is a series of button text and response id pairs. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::InfoBar::new_with_buttons\*(C'\fR is provided. .IP \(bu 4 The default \f(CW\*(C`new\*(C'\fR constructor of Gtk3::LinkButton reroutes to \&\f(CW\*(C`new_with_label\*(C'\fR if given an extra argument. .IP \(bu 4 \&\f(CW\*(C`Gtk3::ListStore::new\*(C'\fR also accepts a list of type names. .IP \(bu 4 Gtk3::ListStore has a \f(CW\*(C`get\*(C'\fR method that calls \f(CW\*(C`Gtk3::TreeModel::get\*(C'\fR instead of \f(CW\*(C`Glib::Object::get\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::ListStore::insert_with_values\*(C'\fR also accepts a list of \f(CW\*(C`column => value\*(C'\fR pairs and reroutes to \f(CW\*(C`insert_with_valuesv\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::ListStore::set\*(C'\fR also accepts a list of \f(CW\*(C`column => value\*(C'\fR pairs. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Menu::popup\*(C'\fR reroutes to \f(CW\*(C`popup_for_device\*(C'\fR for better callback handling. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Menu::popup_for_device\*(C'\fR allows the given menu position func to return only x and y coordinates, defaulting \f(CW\*(C`push_in\*(C'\fR to FALSE. .IP \(bu 4 The default \f(CW\*(C`new\*(C'\fR constructor of Gtk3::MenuItem reroutes to \&\f(CW\*(C`new_with_mnemonic\*(C'\fR if given an extra argument. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::MessageDialog::new\*(C'\fR is provided. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::MessageDialog::new_with_markup\*(C'\fR is provided. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::MessageDialog::format_secondary_text\*(C'\fR and \&\f(CW\*(C`Gtk3::MessageDialog::format_secondary_markup\*(C'\fR is provided .IP \(bu 4 The group handling in the constructors and accessors of Gtk3::RadioAction, Gtk3::RadioButton, Gtk3::RadioMenuItem and Gtk3::RadioToolButton is amended to work correctly when given array refs of group members or single group members. .IP \(bu 4 Perl reimplementations of \f(CW\*(C`Gtk3::RecentChooserDialog::new\*(C'\fR and \&\f(CW\*(C`new_for_manager\*(C'\fR are provided. .IP \(bu 4 Redirects are provided from \f(CW\*(C`Gtk3::Stock::[function]\*(C'\fR to \&\f(CW\*(C`Gtk3::stock_[function]\*(C'\fR for \f(CW\*(C`add\*(C'\fR, \f(CW\*(C`add_static\*(C'\fR, \f(CW\*(C`list_ids\*(C'\fR, \f(CW\*(C`lookup\*(C'\fR and \&\f(CW\*(C`set_translate_func\*(C'\fR. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::StyleContext::get\*(C'\fR is provided. .IP \(bu 4 An override for \f(CW\*(C`Gtk3::TargetEntry::new\*(C'\fR is provided that automatically handles the conversion of the \f(CW\*(C`flags\*(C'\fR argument. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::TextBuffer::create_tag\*(C'\fR is provided. .IP \(bu 4 The \f(CW\*(C`length\*(C'\fR arguments of \f(CW\*(C`Gtk3::TextBuffer::insert\*(C'\fR, \&\f(CW\*(C`insert_at_cursor\*(C'\fR, \f(CW\*(C`insert_interactive\*(C'\fR, \f(CW\*(C`insert_interactive_at_cursor\*(C'\fR, \&\f(CW\*(C`insert_markup\*(C'\fR and \f(CW\*(C`set_text\*(C'\fR are optional. .IP \(bu 4 Perl reimplementations of \f(CW\*(C`Gtk3::TextBuffer::insert_with_tags\*(C'\fR and \&\f(CW\*(C`insert_with_tags_by_name\*(C'\fR are provided which do not require a \f(CW\*(C`length\*(C'\fR argument. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::TreeModel::get\*(C'\fR is provided. .IP \(bu 4 A redirect is added from \f(CW\*(C`Gtk3::TreeModelFilter::new\*(C'\fR to so that Gtk3::TreeModelFilter objects can be constructed normally. .IP \(bu 4 Gtk3::TreeModelFilter has a \f(CW\*(C`get\*(C'\fR method that calls \&\f(CW\*(C`Gtk3::TreeModel::get\*(C'\fR instead of \f(CW\*(C`Glib::Object::get\*(C'\fR. .IP \(bu 4 Prior to gtk+ 3.24.14, a redirect is added from \&\f(CW\*(C`Gtk3::TreeModelSort::new_with_model\*(C'\fR to so that Gtk3::TreeModelSort objects can be constructed normally. .IP \(bu 4 Gtk3::TreeModelSort has a \f(CW\*(C`get\*(C'\fR method that calls \&\f(CW\*(C`Gtk3::TreeModel::get\*(C'\fR instead of \f(CW\*(C`Glib::Object::get\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::TreePath::new\*(C'\fR redirects to \f(CW\*(C`new_from_string\*(C'\fR if an additional argument is given. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::TreePath::new_from_indices\*(C'\fR is provided. .IP \(bu 4 \&\f(CW\*(C`Gtk3::TreeStore::new\*(C'\fR also accepts a list of type names. .IP \(bu 4 Gtk3::TreeStore has a \f(CW\*(C`get\*(C'\fR method that calls \f(CW\*(C`Gtk3::TreeModel::get\*(C'\fR instead of \f(CW\*(C`Glib::Object::get\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::TreeStore::insert_with_values\*(C'\fR also accepts a list of \f(CW\*(C`column => value\*(C'\fR pairs. .IP \(bu 4 \&\f(CW\*(C`Gtk3::TreeStore::set\*(C'\fR also accepts a list of \f(CW\*(C`column => value\*(C'\fR pairs. .IP \(bu 4 \&\f(CW\*(C`Gtk3::TreeView::new\*(C'\fR redirects to \f(CW\*(C`new_with_model\*(C'\fR if an additional argument is given. .IP \(bu 4 A Perl reimplementation of \&\f(CW\*(C`Gtk3::TreeView::insert_column_with_attributes\*(C'\fR is provided. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::TreeViewColumn::new_with_attributes\*(C'\fR is provided. .IP \(bu 4 Perl reimplementations of \f(CW\*(C`Gtk3::TreeViewColumn::set_attributes\*(C'\fR and \&\f(CW\*(C`Gtk3::CellLayout::set_attributes\*(C'\fR are provided. .IP \(bu 4 \&\f(CW\*(C`Gtk3::UIManager::add_ui_from_string\*(C'\fR takes no \f(CW\*(C`length\*(C'\fR argument. .IP \(bu 4 \&\f(CW\*(C`Gtk3::VBox::new\*(C'\fR uses the defaults homogeneous = FALSE and spacing = 5. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Widget::add_events\*(C'\fR and \f(CW\*(C`Gtk3::Widget::set_events\*(C'\fR also accept strings, array references and \f(CW\*(C`Gtk3::Gdk::EventMask\*(C'\fR objects for the \f(CW\*(C`events\*(C'\fR parameter. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Widget::get_events\*(C'\fR returns a \f(CW\*(C`Gtk3::Gdk::EventMask\*(C'\fR object that can also be compared to numeric values with \f(CW\*(C`==\*(C'\fR and \f(CW\*(C`>=\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Widget::find_style_property\*(C'\fR and \&\f(CW\*(C`Gtk3::Widget::list_style_properties\*(C'\fR are forwarded to the corresponding functions in \f(CW\*(C`Gtk3::WidgetClass\*(C'\fR. .IP \(bu 4 A Perl reimplementation of \f(CW\*(C`Gtk3::Widget::style_get\*(C'\fR is provided. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Window::new\*(C'\fR uses the default type = 'toplevel'. .IP \(bu 4 A constructor \f(CW\*(C`Gtk3::Gdk::RGBA::new\*(C'\fR is provided that can be called as \&\f(CW\*(C`Gtk3::Gdk::RGBA\->new (r, g, b, a)\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Gdk::RGBA::parse\*(C'\fR can be called as a function returning a new instance (\f(CW\*(C`$rgba = Gtk3::Gdk::RGBA::parse ($spec)\*(C'\fR) or as a method (\f(CW\*(C`$rgba\->parse ($spec)\*(C'\fR). .IP \(bu 4 \&\f(CW\*(C`Gtk3::Gdk::Window::new\*(C'\fR optionally computes the \f(CW\*(C`attr_mask\*(C'\fR automatically from the given \f(CW\*(C`attr\*(C'\fR. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Gdk::Pixbuf::get_pixels\*(C'\fR returns a byte string. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Gdk::Pixbuf::new_from_data\*(C'\fR is reimplemented in terms of \&\f(CW\*(C`new_from_bytes\*(C'\fR (with gdk-pixbuf >= 2.32) or \f(CW\*(C`new_from_inline\*(C'\fR (with gtk-pixbuf < 2.32) for correct memory management. No \f(CW\*(C`destroy_fn\*(C'\fR and \&\f(CW\*(C`destroy_fn_data\*(C'\fR arguments are needed. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Gdk::Pixbuf::new_from_inline\*(C'\fR does not take a \f(CW\*(C`copy_pixels\*(C'\fR argument. It is always set to TRUE for correct memory management. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Gdk::Pixbuf::new_from_xpm_data\*(C'\fR also accepts a list of XPM lines. .IP \(bu 4 \&\f(CW\*(C`Gtk3::Gdk::Pixbuf::save\*(C'\fR, \f(CW\*(C`save_to_buffer\*(C'\fR and \f(CW\*(C`save_to_callback\*(C'\fR also accept \f(CW\*(C`key => value\*(C'\fR pairs and invoke the correct C function as appropriate for the current gdk-pixbuf version. .IP \(bu 4 The \f(CW\*(C`length\*(C'\fR arguments of \f(CW\*(C`Pango::Layout::set_text\*(C'\fR and \f(CW\*(C`set_markup\*(C'\fR are optional. .SS "Perl compatibility" .IX Subsection "Perl compatibility" As of 5.20.0, perl does not automatically re-check the locale environment for changes. If a function thus changes the locale behind perl's back, problems might arise whenever numbers are formatted, for example when checking versions. To ensure perl's assumption about the locale are up-to-date, the functions \&\f(CW\*(C`Gtk3::init\*(C'\fR, \f(CW\*(C`init_check\*(C'\fR, \f(CW\*(C`init_with_args\*(C'\fR and \f(CW\*(C`parse_args\*(C'\fR are amended to let perl know of any changes. .SS "Porting from Gtk2 to Gtk3" .IX Subsection "Porting from Gtk2 to Gtk3" The majority of the API has not changed, so as a first approximation you can run \f(CW\*(C`s/Gtk2/Gtk3/\*(C'\fR on your application. A big exception to this rule is APIs that were deprecated in gtk+ 2.x \-\- these were all removed from gtk+ 3.0 and thus from Gtk3. The migration guide at describes what to use instead. Apart from this, here is a list of some other incompatible differences between Gtk2 and Gtk3: .IP \(bu 4 The call syntax for class-static methods is now always \&\f(CW\*(C`Gtk3::Stock::lookup\*(C'\fR instead of \f(CW\*(C`Gtk3::Stock\->lookup\*(C'\fR. .IP \(bu 4 The \f(CW%Gtk2::Gdk::Keysyms\fR hash is gone; instead of \f(CW\*(C`Gtk2::Gdk::Keysyms{XYZ}\*(C'\fR, use \f(CW\*(C`Gtk3::Gdk::KEY_XYZ\*(C'\fR. .IP \(bu 4 The Gtk2::Pango compatibility wrapper was not carried over; simply use the namespace "Pango" everywhere. It gets set up automatically when loading Gtk3. .IP \(bu 4 The types Gtk3::Allocation and Gtk3::Gdk::Rectangle are now aliases for Cairo::RectangleInt, and as such they are represented as plain hashes with keys 'width', 'height', 'x' and 'y'. .IP \(bu 4 Gtk3::Editable: Callbacks connected to the "insert-text" signal do not have as many options anymore as they had in Gtk2. Changes to arguments will not be propagated to the next signal handler, and only the updated position can and must be returned. .IP \(bu 4 Gtk3::Menu: In gtk+ < 3.16, the position callback passed to \fBpopup()\fR does not receive x and y parameters. .IP \(bu 4 Gtk3::RadioAction: The constructor now follows the C API. .IP \(bu 4 Gtk3::TreeModel: \fBiter_next()\fR is now a method that is modifying the iter directly, instead of returning a new one. \fBrows_reordered()\fR and the "rows-reordered" signal are currently unusable. .IP \(bu 4 Gtk3::TreeSelection: \fBget_selected_rows()\fR now returns two values: an array ref containing the selected paths, and the model. \fBget_user_data()\fR is not available currently. .IP \(bu 4 Gtk3::TreeSortable: \fBget_sort_column_id()\fR has an additional boolean return value. .IP \(bu 4 Gtk3::TreeStore, Gtk3::ListStore: \fBreorder()\fR is currently unusable. .IP \(bu 4 Gtk3::Widget: \fBgrab_add()\fR and \fBgrab_remove()\fR are methods now: \f(CW\*(C`$widget\->grab_add\*(C'\fR, \f(CW\*(C`$widget\->grab_remove\*(C'\fR. .IP \(bu 4 Gtk3::Gdk::Atom: The constructor \fBnew()\fR is not provided anymore, and the class function \fBintern()\fR must now be called as \f(CW\*(C`Gtk3::Gdk::Atom::intern (name, only_if_exists)\*(C'\fR. .IP \(bu 4 Implementations of Gtk3::TreeModel: Gtk3::TreeIter now has a constructor called \fBnew()\fR expecting \f(CW\*(C`key => value\*(C'\fR pairs; \&\fBnew_from_arrayref()\fR does not exist anymore. To access the contents of Gtk3::TreeIter, use \fBstamp()\fR, \fBuser_data()\fR, \fBuser_data2()\fR and \fBuser_data3()\fR; \&\fBto_arrayref()\fR does not exist anymore. \fBGET_ITER()\fR, \fBITER_CHILDREN()\fR, \&\fBITER_NTH_CHILD()\fR and \fBITER_PARENT()\fR must return an additional boolean value. \&\fBITER_NEXT()\fR must modify the iter and return a boolean rather than return a new iter. \fBGET_VALUE()\fR must return the value wrapped with \f(CW\*(C`Glib::Object::Introspection::GValueWrapper\->new\*(C'\fR. .IP \(bu 4 Implementations of Gtk3::CellLayout: \fBGET_CELLS()\fR now needs to return an array ref instead of a list. .PP Note also that Gtk3::CHECK_VERSION will always fail when passed 2.y.z, so if you have any existing version checks in your code, you will most likely need to remove them. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \(bu 4 To discuss Gtk3 and ask questions join gtk\-perl\-list@gnome.org at . .IP \(bu 4 Also have a look at the gtk2\-perl website and sourceforge project page, . .IP \(bu 4 Glib .IP \(bu 4 Glib::Object::Introspection .SH AUTHORS .IX Header "AUTHORS" .IP "Torsten Schönfeld " 4 .IX Item "Torsten Schönfeld " .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright (C) 2011\-2015 by Torsten Schoenfeld .PP This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.