Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > e40b0b2b839eccdb3c85993a7b738115 > files > 4

gtkmm-documentation-3.24.0-1.mga7.noarch.rpm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 4. Changes in gtkmm 3</title>
<link rel="stylesheet" type="text/css" href="style.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="Programming with gtkmm 3">
<link rel="up" href="index.html" title="Programming with gtkmm 3">
<link rel="prev" href="sec-helloworld.html" title="Hello World in gtkmm">
<link rel="next" href="chapter-button-widget.html" title="Chapter 5. Buttons">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr><th colspan="3" align="center">Chapter 4. Changes in <span class="application">gtkmm</span> 3</th></tr>
<tr>
<td width="20%" align="left">
<a accesskey="p" href="sec-helloworld.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="chapter-button-widget.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
</table>
<hr>
</div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="changes-gtkmm3"></a>Chapter 4. Changes in <span class="application">gtkmm</span> 3</h1></div></div></div>
<p><span class="application">gtkmm</span>-3.0 is a new version of the <span class="application">gtkmm</span> API that installs in parallel with the older <span class="application">gtkmm</span>-2.4 API. The last version of the <span class="application">gtkmm</span>-2.4 API was <span class="application">gtkmm</span> 2.24. <span class="application">gtkmm</span> 3 has no major fundamental differences to <span class="application">gtkmm</span> 2 but does make several small changes that were not possible while maintaining binary compatibility. If you never used the <span class="application">gtkmm</span>-2.4 API then you can safely ignore this chapter.</p>
<p><span class="application">gtkmm</span> 3's library is called <code class="literal">libgtkmm-3.0</code> rather than <code class="literal">libgtkmm-2.4</code> and installs its headers in a similarly-versioned directory, so your pkg-config check should ask for <code class="literal">gtkmm-3.0</code>  rather than <code class="literal">gtkmm-2.4</code>.</p>
<p><span class="application">gtkmm</span> 3 added some new classes:</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<code class="classname">Gtk::AppChooser</code>, <code class="classname">Gtk::AppChooserButton</code>, <code class="classname">Gtk::AppChooserDialog</code> allow the user to select an installed application to open a particular type of content.</li>
<li class="listitem">
<code class="classname">Gtk::Grid</code> is a new container widget that will eventually replace <code class="classname">Gtk::Box</code> and <code class="classname">Gtk::Table</code>. It arranges its children according to properties of those children rather than its own layout details.</li>
<li class="listitem">
<code class="classname">Gtk::Switch</code> displays On/Off states more explictly than <code class="classname">Gtk::CheckBox</code>. It may be useful, for instance, when allowing users to activate hardware.</li>
</ol></div>
<p><span class="application">gtkmm</span> 3 also made several small changes to the API, which you will probably encounter when porting code that used <span class="application">gtkmm</span>-2.4. Here is a short list:</p>
<p>
</p>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<code class="classname">Gtk::CellLayout</code>, used by <code class="classname">Gtk::IconView</code>, <code class="classname">Gtk::TreeView::Column</code> and <code class="classname">Gtk::ComboBox</code>, now has a <code class="classname">Gtk::CellArea</code> which can be used to specify more details of how the <code class="classname">CellRenderer</code>s are arranged and aligned.</li>
<li class="listitem">Gtk::ComboBox now derives from CellLayout, allowing easier layout and alignment of its <code class="classname">Gtk::CellRenderer</code>s.</li>
<li class="listitem">
<code class="classname">Gtk::Adjustment</code> and <code class="classname">IconSet</code> and <code class="classname">Gdk::Cursor</code> are now used via <code class="classname">Glib::RefPtr</code>.</li>
<li class="listitem">
<code class="classname">Gtk::Box</code>, <code class="classname">Gtk::ButtonBox</code>, <code class="classname">Gtk::IconView</code>, <code class="classname">Gtk::Paned</code>, <code class="classname">Gtk::ProgressBar</code>, <code class="classname">Gtk::ScaleButton</code>, <code class="classname">Gtk::Scrollbar</code> and <code class="classname">Gtk::Separator</code> now derive from <code class="classname">Gtk::Orientable</code>, allowing their
orientation (vertical or horizontal) to be specified without requiring the use of a derived class such as <code class="classname">Gtk::HBox</code>.</li>
<li class="listitem">
<code class="classname">Gtk::IconView</code>, <code class="classname">Gtk::TextView</code>, <code class="classname">Gtk::TreeView</code> and other widgets derive from Scrollable instead of having their own methods such as <code class="methodname">get_vadjustment()</code> and instead of having their own set_scroll_adjustments signal.</li>
<li class="listitem">
<code class="classname">Gtk::Style</code> and <code class="classname">Gtk::Rc</code> were removed, replaced by <code class="classname">Gtk::StyleContext</code>, and <code class="classname">Gtk::StyleProvider</code>s, such as <code class="classname">Gtk::CssProvider</code>.</li>
<li class="listitem">Widget::on_expose_event() was replaced by Widget::on_draw(), which assumes that cairomm is used for drawing, via the provided <code class="classname">Cairo::Context</code> and does not require you to call <code class="methodname">Cairo::Context::clip()</code>.</li>
<li class="listitem">
<code class="classname">Gdk::RGBA</code> replaces <code class="classname">Color</code>, adding an alpha component for opacity. <code class="classname">Colormap</code> was removed, along with its awkward use to allocate colors.</li>
<li class="listitem">
<code class="classname">Gdk::Pixmap</code> and <code class="classname">Gdk::Bitmap</code> were removed in favour of <code class="classname">Gdk::Pixbuf</code>.</li>
<li class="listitem">
<code class="classname">Gdk::Drawable</code> was removed, with its methods moving into <code class="classname">Gdk::Window</code>.</li>
<li class="listitem">We now use std::vector in several methods instead of the intermediate *Handle types to make the API clearer.</li>
</ol></div>
<p>
</p>
<p>All deprecated API was removed in <span class="application">gtkmm</span> 3.0, though there will be new deprecations in future versions.</p>
<p>As a first step to porting your source code to <span class="application">gtkmm</span>-3.0 you should probably ensure that your application builds with the deprecated <span class="application">gtkmm</span>-2.4 API disabled, by defining macro such as GTKMM_DISABLE_DEPRECATED. There are some autotools macros that can help with this by defining them optionally at build time. See the <a class="ulink" href="https://wiki.gnome.org/Projects/gtkmm/PortingToGtkmm3" target="_top">gtkmm 3 porting wiki page</a> for more details.</p>
</div>
<div class="navfooter">
<hr>
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left">
<a accesskey="p" href="sec-helloworld.html"><img src="icons/prev.png" alt="Prev"></a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="chapter-button-widget.html"><img src="icons/next.png" alt="Next"></a>
</td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Hello World in <span class="application">gtkmm</span> </td>
<td width="20%" align="center"><a accesskey="h" href="index.html"><img src="icons/home.png" alt="Home"></a></td>
<td width="40%" align="right" valign="top"> Chapter 5. Buttons</td>
</tr>
</table>
</div>
</body>
</html>