674 lines
27 KiB
HTML
674 lines
27 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Gtk3</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Gtk3</H1>
|
|
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2020-03-21<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Gtk3 - Perl interface to the 3.x series of the gtk+ toolkit
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use Gtk3 -init;
|
|
my $window = Gtk3::Window->new ('toplevel');
|
|
my $button = Gtk3::Button->new ('Quit');
|
|
$button->signal_connect (clicked => sub { Gtk3::main_quit });
|
|
$window->add ($button);
|
|
$window->show_all;
|
|
Gtk3::main;
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>ABSTRACT</H2>
|
|
|
|
|
|
|
|
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 <FONT SIZE="-1">API.</FONT>
|
|
<A NAME="lbAE"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
The <TT>"Gtk3"</TT> module allows a Perl developer to use the gtk+ graphical user
|
|
interface library. Find out more about gtk+ at <<A HREF="http://www.gtk.org">http://www.gtk.org</A>>.
|
|
<P>
|
|
|
|
The gtk+ reference manual is also a handy companion when writing <TT>"Gtk3"</TT>
|
|
programs in Perl: <<A HREF="http://developer.gnome.org/gtk3/stable/">http://developer.gnome.org/gtk3/stable/</A>>. The Perl
|
|
bindings follow the C <FONT SIZE="-1">API</FONT> 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 <TT>"Gtk3"</TT> is based.
|
|
<P>
|
|
|
|
Glib::Object::Introspection also comes with the <TT>"perli11ndoc"</TT> program which
|
|
displays the <FONT SIZE="-1">API</FONT> reference documentation of all installed libraries organized
|
|
in accordance with these principles.
|
|
<A NAME="lbAF"> </A>
|
|
<H3>Wrapped libraries</H3>
|
|
|
|
|
|
|
|
<TT>"Gtk3"</TT> automatically sets up the following correspondence between C libraries
|
|
and Perl packages:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
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
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAG"> </A>
|
|
<H3>Import arguments</H3>
|
|
|
|
|
|
|
|
When importing <TT>"Gtk3"</TT>, you can pass <TT>"-init"</TT> as in <TT>"use Gtk3 -init;"</TT> to
|
|
have <TT>"Gtk3::init"</TT> automatically called. You can also pass a version number to
|
|
require a certain version of <TT>"Gtk3"</TT>.
|
|
<A NAME="lbAH"> </A>
|
|
<H3>Customizations and overrides</H3>
|
|
|
|
|
|
|
|
In order to make things more Perlish or to make porting from <TT>"Gtk2"</TT> to <TT>"Gtk3"</TT>
|
|
easier, <TT>"Gtk3"</TT> customizes the <FONT SIZE="-1">API</FONT> generated by Glib::Object::Introspection
|
|
in a few spots:
|
|
<DL COMPACT>
|
|
<DT id="1">•<DD>
|
|
The array ref normally returned by the following functions is flattened
|
|
into a list:
|
|
<DL COMPACT><DT id="2"><DD>
|
|
<DL COMPACT>
|
|
<DT id="3">Gtk3::ActionGroup::list_actions<DD>
|
|
|
|
|
|
|
|
<DT id="4">Gtk3::Builder::get_objects<DD>
|
|
|
|
|
|
<DT id="5">Gtk3::CellLayout::get_cells<DD>
|
|
|
|
|
|
<DT id="6">Gtk3::Container::get_children<DD>
|
|
|
|
|
|
<DT id="7">Gtk3::SizeGroup::get_widgets<DD>
|
|
|
|
|
|
<DT id="8">Gtk3::TreePath::get_indices<DD>
|
|
|
|
|
|
<DT id="9">Gtk3::TreeView::get_columns<DD>
|
|
|
|
|
|
<DT id="10">Gtk3::UIManager::get_action_groups<DD>
|
|
|
|
|
|
<DT id="11">Gtk3::UIManager::get_toplevels<DD>
|
|
|
|
|
|
<DT id="12">Gtk3::Window::list_toplevels<DD>
|
|
|
|
|
|
<DT id="13">Gtk3::stock_list_ids<DD>
|
|
|
|
|
|
<DT id="14">Gtk3::Gdk::Pixbuf::get_formats<DD>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="15"><DD>
|
|
</DL>
|
|
|
|
<DT id="16">•<DD>
|
|
|
|
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.
|
|
<DL COMPACT><DT id="17"><DD>
|
|
<DL COMPACT>
|
|
<DT id="18">Gtk3::TextBuffer::get_selection_bounds<DD>
|
|
|
|
|
|
|
|
<DT id="19">Gtk3::TreeModel::get_iter<DD>
|
|
|
|
|
|
<DT id="20">Gtk3::TreeModel::get_iter_first<DD>
|
|
|
|
|
|
<DT id="21">Gtk3::TreeModel::get_iter_from_string<DD>
|
|
|
|
|
|
<DT id="22">Gtk3::TreeModel::iter_children<DD>
|
|
|
|
|
|
<DT id="23">Gtk3::TreeModel::iter_nth_child<DD>
|
|
|
|
|
|
<DT id="24">Gtk3::TreeModel::iter_parent<DD>
|
|
|
|
|
|
<DT id="25">Gtk3::TreeModelFilter::convert_child_iter_to_iter<DD>
|
|
|
|
|
|
<DT id="26">Gtk3::TreeModelSort::convert_child_iter_to_iter<DD>
|
|
|
|
|
|
<DT id="27">Gtk3::TreeSelection::get_selected<DD>
|
|
|
|
|
|
<DT id="28">Gtk3::TreeView::get_dest_row_at_pos<DD>
|
|
|
|
|
|
<DT id="29">Gtk3::TreeView::get_path_at_pos<DD>
|
|
|
|
|
|
<DT id="30">Gtk3::TreeView::get_tooltip_context<DD>
|
|
|
|
|
|
<DT id="31">Gtk3::TreeView::get_visible_range<DD>
|
|
|
|
|
|
<DT id="32">Gtk3::TreeViewColumn::cell_get_position<DD>
|
|
|
|
|
|
<DT id="33">Gtk3::stock_lookup<DD>
|
|
|
|
|
|
<DT id="34">Gtk3::Gdk::Event::get_axis<DD>
|
|
|
|
|
|
<DT id="35">Gtk3::Gdk::Event::get_button<DD>
|
|
|
|
|
|
<DT id="36">Gtk3::Gdk::Event::get_click_count<DD>
|
|
|
|
|
|
<DT id="37">Gtk3::Gdk::Event::get_coords<DD>
|
|
|
|
|
|
<DT id="38">Gtk3::Gdk::Event::get_keycode<DD>
|
|
|
|
|
|
<DT id="39">Gtk3::Gdk::Event::get_keyval<DD>
|
|
|
|
|
|
<DT id="40">Gtk3::Gdk::Event::get_scroll_direction<DD>
|
|
|
|
|
|
<DT id="41">Gtk3::Gdk::Event::get_scroll_deltas<DD>
|
|
|
|
|
|
<DT id="42">Gtk3::Gdk::Event::get_state<DD>
|
|
|
|
|
|
<DT id="43">Gtk3::Gdk::Event::get_root_coords<DD>
|
|
|
|
|
|
<DT id="44">Gtk3::Gdk::Window::get_origin<DD>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="45"><DD>
|
|
</DL>
|
|
|
|
<DT id="46">•<DD>
|
|
|
|
Values of type Gtk3::ResponseType are converted to and from nick names
|
|
if possible, while still allowing raw IDs, in the following places:
|
|
<DL COMPACT><DT id="47"><DD>
|
|
<DL COMPACT>
|
|
<DT id="48">- 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".<DD>
|
|
|
|
|
|
|
|
|
|
|
|
<DT id="49">- For Gtk3::Dialog: the methods "get_response_for_widget", "get_widget_for_response", "run" and "set_alternative_button_order".<DD>
|
|
|
|
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="50"><DD>
|
|
</DL>
|
|
|
|
<DT id="51">•<DD>
|
|
|
|
Values of type Gtk3::IconSize are converted to and from nick names if
|
|
possible, while still allowing raw IDs, in the following places:
|
|
<DL COMPACT><DT id="52"><DD>
|
|
<DL COMPACT>
|
|
<DT id="53">- 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.<DD>
|
|
|
|
|
|
|
|
<DT id="54">- Gtk3::Widget: the method render_icon.<DD>
|
|
|
|
|
|
</DL>
|
|
</DL>
|
|
|
|
<DL COMPACT><DT id="55"><DD>
|
|
</DL>
|
|
|
|
<DT id="56">•<DD>
|
|
|
|
The constants <TT>"Gtk3::EVENT_PROPAGATE"</TT> and <TT>"Gtk3::EVENT_STOP"</TT> can be
|
|
used in handlers for event signals like <TT>"key-press-event"</TT> to indicate whether
|
|
or not the event should continue propagating through the widget hierarchy.
|
|
<DT id="57">•<DD>
|
|
The records corresponding to the various Gtk3::Gdk::Event types, like
|
|
<TT>"expose"</TT> or <TT>"key-release"</TT>, are represented as objects blessed into specific
|
|
Perl packages, like <TT>"Gtk3::Gdk::EventExpose"</TT> or <TT>"Gtk3::Gdk::EventKey"</TT>, that
|
|
all inherit from <TT>"Gtk3::Gdk::Event"</TT>. This allows you to seemlessly access
|
|
type-specific fields as well as common fields, as in <TT>"$event->window"</TT> or
|
|
<TT>"$event->keyval"</TT>.
|
|
<DT id="58">•<DD>
|
|
Gtk3::Gdk::Atom has overloads for the <TT>"=="</TT> and <TT>"!="</TT> operators that
|
|
check for equality of the underlying atoms.
|
|
<DT id="59">•<DD>
|
|
For backwards compatibility, the functions <TT>"Gtk3::get_version_info"</TT>
|
|
and <TT>"Gtk3::GET_VERSION_INFO"</TT> are provided, and the functions
|
|
<TT>"Gtk3::CHECK_VERSION"</TT>, <TT>"Gtk3::check_version"</TT>, <TT>"Gtk3::init"</TT>,
|
|
<TT>"Gtk3::init_check"</TT>, <TT>"Gtk3::main"</TT>, <TT>"Gtk3::main_level"</TT> and <TT>"Gtk3::main_quit"</TT>
|
|
can be called as class-static or as normal functions: for example, <TT>"Gtk3->main_quit"</TT> and <TT>"Gtk3::main_quit"</TT> are both supported.
|
|
Additionally, <TT>"Gtk3::init"</TT> and <TT>"Gtk3::init_check"</TT> automatically handle
|
|
passing and updating <TT>@ARGV</TT> as appropriate.
|
|
<DT id="60">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::show_about_dialog"</TT> is provided.
|
|
<DT id="61">•<DD>
|
|
Perl reimplementations of <TT>"Gtk3::ActionGroup::add_actions"</TT>,
|
|
<TT>"add_radio_actions"</TT> and <TT>"add_toggle_actions"</TT> are provided.
|
|
<DT id="62">•<DD>
|
|
<TT>"Gtk3::Builder::add_objects_from_file"</TT> and <TT>"add_objects_from_string"</TT>
|
|
also accept a list of objects instead of an array ref.
|
|
<DT id="63">•<DD>
|
|
<TT>"Gtk3::Builder::add_objects_from_string"</TT> and <TT>"add_from_string"</TT> don't
|
|
take length arguments, as they are computed automatically.
|
|
<DT id="64">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::Builder::connect_signals"</TT> is
|
|
provided.
|
|
<DT id="65">•<DD>
|
|
The default <TT>"new"</TT> constructors of Gtk3::Button, Gtk3::CheckButton,
|
|
Gtk3::ColorButton, Gtk3::FontButton and Gtk3::ToggleButton reroute to
|
|
<TT>"new_with_mnemonic"</TT> if given an extra argument.
|
|
<DT id="66">•<DD>
|
|
The default <TT>"new"</TT> constructor of Gtk3::CheckMenuItem reroutes to
|
|
<TT>"new_with_mnemonic"</TT> if given an extra argument.
|
|
<DT id="67">•<DD>
|
|
The <TT>"length"</TT> argument of <TT>"Gtk3::Clipboard::set_text"</TT> is optional.
|
|
<DT id="68">•<DD>
|
|
Perl reimplementations of <TT>"Gtk3::Container::add_with_properties"</TT>,
|
|
<TT>"Gtk3::Container::child_get"</TT> and <TT>"Gtk3::Container::child_set"</TT> are provided.
|
|
<DT id="69">•<DD>
|
|
<TT>"Gtk3::Container::find_child_property"</TT> and
|
|
<TT>"Gtk3::Container::list_child_properties"</TT> are forwarded to the corresponding
|
|
functions in <TT>"Gtk3::ContainerClass"</TT>.
|
|
<DT id="70">•<DD>
|
|
<TT>"Gtk3::Container::get_focus_chain"</TT> returns a list of widgets, or an
|
|
empty list.
|
|
<DT id="71">•<DD>
|
|
<TT>"Gtk3::Container::set_focus_chain"</TT> also accepts a list of widgets.
|
|
<DT id="72">•<DD>
|
|
<TT>"Gtk3::CssProvider::load_from_data"</TT> also accepts a string.
|
|
<DT id="73">•<DD>
|
|
For Gtk3::Dialog and Gtk3::InfoBar, a Perl implementation of
|
|
<TT>"add_buttons"</TT> is provided.
|
|
<DT id="74">•<DD>
|
|
<TT>"Gtk3::Dialog::new"</TT> can optionally be called as <TT>"Gtk3::Dialog->new
|
|
(TITLE, PARENT, FLAGS, ...)"</TT> where <TT>"..."</TT> is a series of button text and
|
|
response id pairs.
|
|
<DT id="75">•<DD>
|
|
A Perl implementation of <TT>"Gtk3::Dialog::new_with_buttons"</TT> is provided.
|
|
<DT id="76">•<DD>
|
|
The <TT>"length"</TT> argument of <TT>"Gtk3::Editable::insert_text"</TT> is optional.
|
|
<DT id="77">•<DD>
|
|
A Perl implementation of <TT>"Gtk3::FileChooserDialog::new"</TT> is provided.
|
|
<DT id="78">•<DD>
|
|
<TT>"Gtk3::HBox::new"</TT> uses the defaults homogeneous = <FONT SIZE="-1">FALSE</FONT> and spacing =
|
|
5.
|
|
<DT id="79">•<DD>
|
|
The default <TT>"new"</TT> constructor of Gtk3::ImageMenuItem reroutes to
|
|
<TT>"new_with_mnemonic"</TT> if given an extra argument.
|
|
<DT id="80">•<DD>
|
|
<TT>"Gtk3::InfoBar::new"</TT> can optionally be called as <TT>"Gtk3::InfoBar->new (...)"</TT> where <TT>"..."</TT> is a series of button text and
|
|
response id pairs.
|
|
<DT id="81">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::InfoBar::new_with_buttons"</TT> is
|
|
provided.
|
|
<DT id="82">•<DD>
|
|
The default <TT>"new"</TT> constructor of Gtk3::LinkButton reroutes to
|
|
<TT>"new_with_label"</TT> if given an extra argument.
|
|
<DT id="83">•<DD>
|
|
<TT>"Gtk3::ListStore::new"</TT> also accepts a list of type names.
|
|
<DT id="84">•<DD>
|
|
Gtk3::ListStore has a <TT>"get"</TT> method that calls <TT>"Gtk3::TreeModel::get"</TT>
|
|
instead of <TT>"Glib::Object::get"</TT>.
|
|
<DT id="85">•<DD>
|
|
<TT>"Gtk3::ListStore::insert_with_values"</TT> also accepts a list of <TT>"column => value"</TT> pairs and reroutes to <TT>"insert_with_valuesv"</TT>.
|
|
<DT id="86">•<DD>
|
|
<TT>"Gtk3::ListStore::set"</TT> also accepts a list of <TT>"column => value"</TT>
|
|
pairs.
|
|
<DT id="87">•<DD>
|
|
<TT>"Gtk3::Menu::popup"</TT> reroutes to <TT>"popup_for_device"</TT> for better
|
|
callback handling.
|
|
<DT id="88">•<DD>
|
|
<TT>"Gtk3::Menu::popup_for_device"</TT> allows the given menu position func to
|
|
return only x and y coordinates, defaulting <TT>"push_in"</TT> to <FONT SIZE="-1">FALSE.</FONT>
|
|
<DT id="89">•<DD>
|
|
The default <TT>"new"</TT> constructor of Gtk3::MenuItem reroutes to
|
|
<TT>"new_with_mnemonic"</TT> if given an extra argument.
|
|
<DT id="90">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::MessageDialog::new"</TT> is provided.
|
|
<DT id="91">•<DD>
|
|
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.
|
|
<DT id="92">•<DD>
|
|
Perl reimplementations of <TT>"Gtk3::RecentChooserDialog::new"</TT> and
|
|
<TT>"new_for_manager"</TT> are provided.
|
|
<DT id="93">•<DD>
|
|
Redirects are provided from <TT>"Gtk3::Stock::[function]"</TT> to
|
|
<TT>"Gtk3::stock_[function]"</TT> for <TT>"add"</TT>, <TT>"add_static"</TT>, <TT>"list_ids"</TT>, <TT>"lookup"</TT> and
|
|
<TT>"set_translate_func"</TT>.
|
|
<DT id="94">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::StyleContext::get"</TT> is provided.
|
|
<DT id="95">•<DD>
|
|
An override for <TT>"Gtk3::TargetEntry::new"</TT> is provided that
|
|
automatically handles the conversion of the <TT>"flags"</TT> argument.
|
|
<DT id="96">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::TextBuffer::create_tag"</TT> is provided.
|
|
<DT id="97">•<DD>
|
|
The <TT>"length"</TT> arguments of <TT>"Gtk3::TextBuffer::insert"</TT>,
|
|
<TT>"insert_at_cursor"</TT>, <TT>"insert_interactive"</TT>, <TT>"insert_interactive_at_cursor"</TT>,
|
|
<TT>"insert_markup"</TT> and <TT>"set_text"</TT> are optional.
|
|
<DT id="98">•<DD>
|
|
Perl reimplementations of <TT>"Gtk3::TextBuffer::insert_with_tags"</TT> and
|
|
<TT>"insert_with_tags_by_name"</TT> are provided which do not require a <TT>"length"</TT>
|
|
argument.
|
|
<DT id="99">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::TreeModel::get"</TT> is provided.
|
|
<DT id="100">•<DD>
|
|
A redirect is added from <TT>"Gtk3::TreeModelFilter::new"</TT> to
|
|
<Gtk3::TreeModel::filter_new> so that Gtk3::TreeModelFilter objects can be
|
|
constructed normally.
|
|
<DT id="101">•<DD>
|
|
Gtk3::TreeModelFilter has a <TT>"get"</TT> method that calls
|
|
<TT>"Gtk3::TreeModel::get"</TT> instead of <TT>"Glib::Object::get"</TT>.
|
|
<DT id="102">•<DD>
|
|
Prior to gtk+ 3.24.14, a redirect is added from
|
|
<TT>"Gtk3::TreeModelSort::new_with_model"</TT> to
|
|
<Gtk3::TreeModel::sort_new_with_model> so that Gtk3::TreeModelSort objects can
|
|
be constructed normally.
|
|
<DT id="103">•<DD>
|
|
Gtk3::TreeModelSort has a <TT>"get"</TT> method that calls
|
|
<TT>"Gtk3::TreeModel::get"</TT> instead of <TT>"Glib::Object::get"</TT>.
|
|
<DT id="104">•<DD>
|
|
<TT>"Gtk3::TreePath::new"</TT> redirects to <TT>"new_from_string"</TT> if an additional
|
|
argument is given.
|
|
<DT id="105">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::TreePath::new_from_indices"</TT> is
|
|
provided.
|
|
<DT id="106">•<DD>
|
|
<TT>"Gtk3::TreeStore::new"</TT> also accepts a list of type names.
|
|
<DT id="107">•<DD>
|
|
Gtk3::TreeStore has a <TT>"get"</TT> method that calls <TT>"Gtk3::TreeModel::get"</TT>
|
|
instead of <TT>"Glib::Object::get"</TT>.
|
|
<DT id="108">•<DD>
|
|
<TT>"Gtk3::TreeStore::insert_with_values"</TT> also accepts a list of <TT>"column => value"</TT> pairs.
|
|
<DT id="109">•<DD>
|
|
<TT>"Gtk3::TreeStore::set"</TT> also accepts a list of <TT>"column => value"</TT>
|
|
pairs.
|
|
<DT id="110">•<DD>
|
|
<TT>"Gtk3::TreeView::new"</TT> redirects to <TT>"new_with_model"</TT> if an additional
|
|
argument is given.
|
|
<DT id="111">•<DD>
|
|
A Perl reimplementation of
|
|
<TT>"Gtk3::TreeView::insert_column_with_attributes"</TT> is provided.
|
|
<DT id="112">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::TreeViewColumn::new_with_attributes"</TT>
|
|
is provided.
|
|
<DT id="113">•<DD>
|
|
Perl reimplementations of <TT>"Gtk3::TreeViewColumn::set_attributes"</TT> and
|
|
<TT>"Gtk3::CellLayout::set_attributes"</TT> are provided.
|
|
<DT id="114">•<DD>
|
|
<TT>"Gtk3::UIManager::add_ui_from_string"</TT> takes no <TT>"length"</TT> argument.
|
|
<DT id="115">•<DD>
|
|
<TT>"Gtk3::VBox::new"</TT> uses the defaults homogeneous = <FONT SIZE="-1">FALSE</FONT> and spacing =
|
|
5.
|
|
<DT id="116">•<DD>
|
|
<TT>"Gtk3::Widget::add_events"</TT> and <TT>"Gtk3::Widget::set_events"</TT> also accept
|
|
strings, array references and <TT>"Gtk3::Gdk::EventMask"</TT> objects for the <TT>"events"</TT>
|
|
parameter.
|
|
<DT id="117">•<DD>
|
|
<TT>"Gtk3::Widget::get_events"</TT> returns a <TT>"Gtk3::Gdk::EventMask"</TT> object
|
|
that can also be compared to numeric values with <TT>"=="</TT> and <TT>">="</TT>.
|
|
<DT id="118">•<DD>
|
|
<TT>"Gtk3::Widget::find_style_property"</TT> and
|
|
<TT>"Gtk3::Widget::list_style_properties"</TT> are forwarded to the corresponding
|
|
functions in <TT>"Gtk3::WidgetClass"</TT>.
|
|
<DT id="119">•<DD>
|
|
A Perl reimplementation of <TT>"Gtk3::Widget::style_get"</TT> is provided.
|
|
<DT id="120">•<DD>
|
|
<TT>"Gtk3::Window::new"</TT> uses the default type = 'toplevel'.
|
|
<DT id="121">•<DD>
|
|
A constructor <TT>"Gtk3::Gdk::RGBA::new"</TT> is provided that can be called as
|
|
<TT>"Gtk3::Gdk::RGBA->new (r, g, b, a)"</TT>.
|
|
<DT id="122">•<DD>
|
|
<TT>"Gtk3::Gdk::RGBA::parse"</TT> can be called as a function returning a new
|
|
instance (<TT>"$rgba = Gtk3::Gdk::RGBA::parse ($spec)"</TT>) or as a method (<TT>"$rgba->parse ($spec)"</TT>).
|
|
<DT id="123">•<DD>
|
|
<TT>"Gtk3::Gdk::Window::new"</TT> optionally computes the <TT>"attr_mask"</TT>
|
|
automatically from the given <TT>"attr"</TT>.
|
|
<DT id="124">•<DD>
|
|
<TT>"Gtk3::Gdk::Pixbuf::get_pixels"</TT> returns a byte string.
|
|
<DT id="125">•<DD>
|
|
<TT>"Gtk3::Gdk::Pixbuf::new_from_data"</TT> is reimplemented in terms of
|
|
<TT>"new_from_bytes"</TT> (with gdk-pixbuf >= 2.32) or <TT>"new_from_inline"</TT> (with
|
|
gtk-pixbuf < 2.32) for correct memory management. No <TT>"destroy_fn"</TT> and
|
|
<TT>"destroy_fn_data"</TT> arguments are needed.
|
|
<DT id="126">•<DD>
|
|
<TT>"Gtk3::Gdk::Pixbuf::new_from_inline"</TT> does not take a <TT>"copy_pixels"</TT>
|
|
argument. It is always set to <FONT SIZE="-1">TRUE</FONT> for correct memory management.
|
|
<DT id="127">•<DD>
|
|
<TT>"Gtk3::Gdk::Pixbuf::new_from_xpm_data"</TT> also accepts a list of <FONT SIZE="-1">XPM</FONT>
|
|
lines.
|
|
<DT id="128">•<DD>
|
|
<TT>"Gtk3::Gdk::Pixbuf::save"</TT>, <TT>"save_to_buffer"</TT> and <TT>"save_to_callback"</TT>
|
|
also accept <TT>"key => value"</TT> pairs and invoke the correct C function as
|
|
appropriate for the current gdk-pixbuf version.
|
|
<DT id="129">•<DD>
|
|
The <TT>"length"</TT> arguments of <TT>"Pango::Layout::set_text"</TT> and <TT>"set_markup"</TT>
|
|
are optional.
|
|
</DL>
|
|
<A NAME="lbAI"> </A>
|
|
<H3>Perl compatibility</H3>
|
|
|
|
|
|
|
|
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
|
|
<TT>"Gtk3::init"</TT>, <TT>"init_check"</TT>, <TT>"init_with_args"</TT> and <TT>"parse_args"</TT> are amended
|
|
to let perl know of any changes.
|
|
<A NAME="lbAJ"> </A>
|
|
<H3>Porting from Gtk2 to Gtk3</H3>
|
|
|
|
|
|
|
|
The majority of the <FONT SIZE="-1">API</FONT> has not changed, so as a first approximation you can
|
|
run <TT>"s/Gtk2/Gtk3/"</TT> 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
|
|
<<A HREF="http://developer.gnome.org/gtk3/stable/migrating.html">http://developer.gnome.org/gtk3/stable/migrating.html</A>> describes what to use
|
|
instead. Apart from this, here is a list of some other incompatible
|
|
differences between Gtk2 and Gtk3:
|
|
<DL COMPACT>
|
|
<DT id="130">•<DD>
|
|
The call syntax for class-static methods is now always
|
|
<TT>"Gtk3::Stock::lookup"</TT> instead of <TT>"Gtk3::Stock->lookup"</TT>.
|
|
<DT id="131">•<DD>
|
|
The <TT>%Gtk2::Gdk::Keysyms</TT> hash is gone; instead of <TT>"Gtk2::Gdk::Keysyms{XYZ}"</TT>, use <TT>"Gtk3::Gdk::KEY_XYZ"</TT>.
|
|
<DT id="132">•<DD>
|
|
The Gtk2::Pango compatibility wrapper was not carried over; simply use
|
|
the namespace ``Pango'' everywhere. It gets set up automatically when loading
|
|
Gtk3.
|
|
<DT id="133">•<DD>
|
|
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'.
|
|
<DT id="134">•<DD>
|
|
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.
|
|
<DT id="135">•<DD>
|
|
Gtk3::Menu: In gtk+ < 3.16, the position callback passed to <B>popup()</B>
|
|
does not receive x and y parameters.
|
|
<DT id="136">•<DD>
|
|
Gtk3::RadioAction: The constructor now follows the C <FONT SIZE="-1">API.</FONT>
|
|
<DT id="137">•<DD>
|
|
Gtk3::TreeModel: <B>iter_next()</B> is now a method that is modifying the iter
|
|
directly, instead of returning a new one. <B>rows_reordered()</B> and the
|
|
``rows-reordered'' signal are currently unusable.
|
|
<DT id="138">•<DD>
|
|
Gtk3::TreeSelection: <B>get_selected_rows()</B> now returns two values: an
|
|
array ref containing the selected paths, and the model. <B>get_user_data()</B> is not
|
|
available currently.
|
|
<DT id="139">•<DD>
|
|
Gtk3::TreeSortable: <B>get_sort_column_id()</B> has an additional boolean
|
|
return value.
|
|
<DT id="140">•<DD>
|
|
Gtk3::TreeStore, Gtk3::ListStore: <B>reorder()</B> is currently unusable.
|
|
<DT id="141">•<DD>
|
|
Gtk3::Widget: <B>grab_add()</B> and <B>grab_remove()</B> are methods now: <TT>"$widget->grab_add"</TT>, <TT>"$widget->grab_remove"</TT>.
|
|
<DT id="142">•<DD>
|
|
Gtk3::Gdk::Atom: The constructor <B>new()</B> is not provided anymore, and the
|
|
class function <B>intern()</B> must now be called as <TT>"Gtk3::Gdk::Atom::intern
|
|
(name, only_if_exists)"</TT>.
|
|
<DT id="143">•<DD>
|
|
Implementations of Gtk3::TreeModel: Gtk3::TreeIter now has a
|
|
constructor called <B>new()</B> expecting <TT>"key => value"</TT> pairs;
|
|
<B>new_from_arrayref()</B> does not exist anymore. To access the contents of
|
|
Gtk3::TreeIter, use <B>stamp()</B>, <B>user_data()</B>, <B>user_data2()</B> and <B>user_data3()</B>;
|
|
<B>to_arrayref()</B> does not exist anymore. <FONT SIZE="-1"><B>GET_ITER</B></FONT><B>()</B>, <FONT SIZE="-1"><B>ITER_CHILDREN</B></FONT><B>()</B>,
|
|
<FONT SIZE="-1"><B>ITER_NTH_CHILD</B></FONT><B>()</B> and <FONT SIZE="-1"><B>ITER_PARENT</B></FONT><B>()</B> must return an additional boolean value.
|
|
<FONT SIZE="-1"><B>ITER_NEXT</B></FONT><B>()</B> must modify the iter and return a boolean rather than return a new
|
|
iter. <FONT SIZE="-1"><B>GET_VALUE</B></FONT><B>()</B> must return the value wrapped with <TT>"Glib::Object::Introspection::GValueWrapper->new"</TT>.
|
|
<DT id="144">•<DD>
|
|
Implementations of Gtk3::CellLayout: <FONT SIZE="-1"><B>GET_CELLS</B></FONT><B>()</B> now needs to return an
|
|
array ref instead of a list.
|
|
</DL>
|
|
<P>
|
|
|
|
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.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="145">•<DD>
|
|
To discuss Gtk3 and ask questions join <A HREF="mailto:gtk-perl-list@gnome.org">gtk-perl-list@gnome.org</A> at
|
|
<<A HREF="http://mail.gnome.org/mailman/listinfo/gtk-perl-list">http://mail.gnome.org/mailman/listinfo/gtk-perl-list</A>>.
|
|
<DT id="146">•<DD>
|
|
Also have a look at the gtk2-perl website and sourceforge project page,
|
|
<<A HREF="http://gtk2-perl.sourceforge.net">http://gtk2-perl.sourceforge.net</A>>.
|
|
<DT id="147">•<DD>
|
|
Glib
|
|
<DT id="148">•<DD>
|
|
Glib::Object::Introspection
|
|
</DL>
|
|
<A NAME="lbAL"> </A>
|
|
<H2>AUTHORS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="149">Torsten Schönfeld <<A HREF="mailto:kaffeetisch@gmx.de">kaffeetisch@gmx.de</A>><DD>
|
|
|
|
|
|
</DL>
|
|
<A NAME="lbAM"> </A>
|
|
<H2>COPYRIGHT AND LICENSE</H2>
|
|
|
|
|
|
|
|
Copyright (C) 2011-2015 by Torsten Schoenfeld <<A HREF="mailto:kaffeetisch@gmx.de">kaffeetisch@gmx.de</A>>
|
|
<P>
|
|
|
|
This library is free software; you can redistribute it and/or modify it under
|
|
the terms of the <FONT SIZE="-1">GNU</FONT> 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.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="150"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="151"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="152"><A HREF="#lbAD">ABSTRACT</A><DD>
|
|
<DT id="153"><A HREF="#lbAE">DESCRIPTION</A><DD>
|
|
<DL>
|
|
<DT id="154"><A HREF="#lbAF">Wrapped libraries</A><DD>
|
|
<DT id="155"><A HREF="#lbAG">Import arguments</A><DD>
|
|
<DT id="156"><A HREF="#lbAH">Customizations and overrides</A><DD>
|
|
<DT id="157"><A HREF="#lbAI">Perl compatibility</A><DD>
|
|
<DT id="158"><A HREF="#lbAJ">Porting from Gtk2 to Gtk3</A><DD>
|
|
</DL>
|
|
<DT id="159"><A HREF="#lbAK">SEE ALSO</A><DD>
|
|
<DT id="160"><A HREF="#lbAL">AUTHORS</A><DD>
|
|
<DT id="161"><A HREF="#lbAM">COPYRIGHT AND LICENSE</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:45 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|