Commit 78e5bf13 authored by Murray Cumming's avatar Murray Cumming

Initial revision

See the ChangeLog for up-to-date information.
Murray Cumming <>
Daniel Elstner <>
Former contributors:
Karl Nelson <>
Tero Pulkkinen <>
Elliot Lee <>
Phil Dawes <>
Erik Andersen <>
Bibek Sahu <>
Mirko Streckenbach
Havoc Pennington <>
Guillaume Laurent <>
Todd Dukes <>
Peter Lerner <>
Herbert Valerio Riedel <>
*** #Include "gtkmm/something.h" instead of "gtk--/something.h"
As well as using the new gtkmm name, this means that we don't need to move
the old gtk-- 1.2 headers into a version-specific directory. However, the
new gtkmm 2.0 headers are in a version-specific directory, so this won't
happen again for gtkmm 2.2.
*** Glib::ustring:
glib::ustring has much the same interface as std::string,
but contains UTF8 strings.
Note that a normal ANSI string is also a UTF8 string, so,
if you want to, you can use this class without every thinking about UTF8.
Also, this class has conversions to and from std::string,
so you can use a std::string instead of a glib::ustring -
However, this will not work with multi-byte translations,
just as normal C char* code wouldn't.
In a perfect world the C++ Standard Library would contain a
a UTF8 string, but it doesn't.
*** The main window concept
In gtkmm 1.2 you had to worry about the Window's delete_event signal to make your application quit properly. If you didn't or if you got it wrong then your Window would self-destruct and cause a segfault. This was tedious and difficult, and nobody really understood it.
We've made life simpler by preventing Window from self-destructing, and adding the Gtk::Main::run(window) override. It shows the window, starts the event loop, and stops the event loop when the window is closed. You can think of it as a way to say 'This is the main application window.' or 'The window and the application have the same lifetime. The examples now demonstrate this simpler technique.
*** Glib::RefPtr<>:
Most of the GDK objects are now based on GObject,
so we now have auto-generated classes for them. However, GObject is a bit
stricter than GtkObject about how we can manage it's memory. We can only
unref() a GObject, we can never destroy it. Therefore our C++ wrapper (which
is used by the C GObject) must remain alive as long as the C instance. But of
course it should be deleted when glib tells us that the C instance has died.
Of course you don't want to worry about all that, so we've created RefPtr<>
which does all that for you. Objects such as Gdk::Bitmap can now only be
instantiated with a create() function. For instance,
Glib::RefPtr<Gdk::Bitmap> bitmap
= Gdk::Bitmap::create(window, data, width, height);
You have no way of getting a bare Gdk::Bitmap.
bitmap is then a smart pointer, so you can do this, much like a normal
int depth = bitmap->get_depth().
When bitmap goes out of scope an unref() will happen in the background and you
don't need to worry about it anymore.
This should mean that you *never* need to ref()/unref() a Gdk
object again. GTK+ is a little inconsistent about it's refcounting, though there
are a loose set of rules. All gtkmm methods do any extra referencing for you, so
you don't need to worry about that.
*** Re-written GDK wrappers
The GDK wrappers are now auto-generated and are in the Gdk namespace. With the use of Glib::RefPtr<> you no longer need to worry about ref-counting issues.
*** Clearly-named default signal handlers
Default signal handlers were previously suffixed with _impl - for instance, Button::clicked_impl(). Now that they are prefixed with on_ - for instance, Button::on_clicked() is is much easier to see that they are signal handlers that are worthwhile to override in derived classes.
*** signals prefixed by signal_
For instance, Button::clicked is now Button::signal_clicked. This makes the API and your code clearer, while also avoiding clashes with methods of the same name - for instance, Button::clicked().
*** signals connected via signal accessors.
For instance,
gtkmm 1.2: button.clicked.connect(SigC::slot(this, &Something::somemethod));
gtkmm 1.3: button.signal_clicked().connect(SigC::slot(*this, &Something::somemethod));
*** C++ types used in signal handlers
Signal handlers now use C++ types, just like other C++ methods.
*** Signals do not have slots.
In gtkmm1.2, you could connect a Signal to the 'Slot' of another signal, for instance Gtk::Main::quit.slot(). The actual action that then happened when the signal was emitted was quite arbitrary. These slots did not have any consistent connection with the signal. Therefore we have removed this idea.
*** Namespaced enums:
gtkmm interfaces now use C++ enums rather than the original GTK+ enums.
*** properties:
GTK+ properties can be used like so:
int value = someobject.property_something().get_value();
or alternatively:
someobject.property_something() = 2;
int value = someobject.property_something();
*** GTK+ changes:
Methods and classes that are now deprecated in GTK+ 2.0 are not wrapped in gtkmm 2.0.
Implementation Changes:
*** Much clearer, better documented, more maintainable code-generating code.
*** Use of gtk+'s .defs C interface-definition format, parsed by perl.
*** Seperate .hg/.ccg files parsed by perl.
*** Wrappers for GObject, GtkObject, and Boxed Types.
This diff is collapsed.
See the MAINTAINERS file.
mailing list:
For information about submitting patches, see
GNOME sherrifs may make changes if they can't get a quick maintainer response from the mailing list or bugzilla.
**** Building from CVS - see README too:
When building from CVS you will probably need to install this Perl module:
\ No newline at end of file
Murray Cumming <>
Daniel Elstner <>
SUBDIRS = tools glib pango atk gdk gtk docs
DIST_SUBDIRS = $(SUBDIRS) scripts demos examples tests
build_shared/Makefile_build.am_fragment \
build_shared/Makefile_build_gensrc.am_fragment \
build_shared/Makefile_gensrc.am_fragment \
build_shared/Makefile_gensrc_platform.am_fragment \
build_shared/Makefile_build_extra.am_fragment \
@echo "*** Everything completed ***"
@echo; echo; \
echo "**********************************************************"; \
echo "* IMPORTANT NOTICE: *"; \
echo "* *"; \
echo "* Be sure you have done a complete build before running *"; \
echo "* 'make dist' or 'make distcheck', because otherwise *"; \
echo "* the tarball will _not_ contain the dependency rules *"; \
echo "* generated by the compiler. *"; \
echo "**********************************************************"; \
echo; echo
include $(top_srcdir)/docs/Makefile_web.am_fragment
doc_tarball_files = \
docs/index.html docs/FAQ/html docs/images/*.gif \
docs/internal/*.txt docs/internal/*.dia docs/reference/html \
docs/tutorial/figures/*.png docs/tutorial/html
# This doesn't work very well in a $(srcdir) != $(builddir) setup,
# but this target is for maintainer use only anyway.
find examples -name '*.cc' -o -name '*.h' -o -name '*.xpm' -o -name '*.xml' | \
tar cf - --files-from - $(doc_tarball_files) | gzip -c --best >$@
# Upload documentation and examples:
list='docs examples'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) post-html); \
post-html-local: gtkmm-docs.tar.gz
rsync $(rsync_args) gtkmm-docs.tar.gz $$$(web_path_gtkmm2)
post-html: post-html-recursive post-html-local
(cd docs && $(MAKE) $(AM_MAKEFLAGS) doc-clean)
doc-clean: doc-clean-recursive
(cd docs && $(MAKE) $(AM_MAKEFLAGS) doc-rebuild)
.PHONY: post-html post-html-local post-html-recursive doc-clean doc-clean-recursive doc-rebuild
This diff is collapsed.
This is the unstable version of gtkmm, aimed at Gtk+ 2.0.x.
See CHANGES for a comparison with gtkmm 1.2.
* Your unstable development environment
* Required libraries:
Your unstable development environment
Until the GTK+ 2.0 / GNOME 2.0 platform is stable, you should try to separate these unstable libraries from your stable GTK+ 1.2 / GNOME 1.2/1.4 libraries. You can do this by installing the unstable libraries into a different prefix.
e.g. ./configure --prefix=/usr/devgnome2
When using the development libraries, you will need to modify some environment variables. This will be easier if you create a file (e.g. devgnome2) in your home directory that contains these commands:
export PATH="/usr/devgnome2/bin:$PATH"; export LD_LIBRARY_PATH="/usr/devgnome2/lib" ; export PKG_CONFIG_PATH="/usr/devgnome2/lib/pkgconfig:$PKG_CONFIG_PATH" ;
You can then type
# source devgnome2
to prepare your environment before building or working with the development libraries.
You may also need to edit /etc/ to add /usr/devgnome2/lib, and then type /sbin/ldconfig to re-process the
The vicious-build-scripts module in might help you with this, if you can get it to work.
Required Libraries
* Of course, you will need gtk+ 2 and its dependencies.
* libsigc++ 1.2 (A release, or libsigc++-1.2 from cvs)
Building gtkmm under Sun Solaris
This README refers currently only to Sun Forte[tm] C++ compiler (WS6U2)
under Solaris 8/Sparc.
The described procedure to compile gtkmm with Sun's commercial C++
compiler assumes the default compiler installation of Forte[tm] C++ 6
update 2. Furthermore all currently available product and adequate SunOS
patches for Forte[tm] C++ 6 update 2, which can be donwload from the
links given at, have
to be applied. After that your compiler should give the following
version information:
$ CC -V
CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-10 2002/09/16
You will not be able to compile gtkmm with the unpatched compiler
installation. Also, it is important to hide any gcc installation
from your PATH.
The installation procedure:
* Recent version of the following GNU utilities should be avalaible in
your PATH:
make (3.79.1)
libtool (1.4.2)
m4 (1.4)
perl (5.6.1)
The version information (in brackets) apply to my GNU installation.
* Assumed your compiler installation is in /opt/SUNWspro, the following
environment changes are required:
CFLAGS="-g" or "-g -xO3" for better optimization
CXXFLAGS="-g" or "-g -O3" for better optimization
* Select an installation directory ($PREFIX).
* The image libraries jpeg-6b, libpng-1.2.5 and tiff-v3.5.7 are pre-
requisites to build gtk+ libraries. They can be obtained from or build from source. Compiling from source
requires some manual corrections (basically prefix settings in the
makefiles), because their build mechanism are rather old. All three
libraries should be build as shared libraries and installed to the
choosen installation directory.
* gtk+-Installation. For each package of pkgconfig-0.12.0, glib-2.0.6,
atk-1.0.3, pango-1.0.4, gtk+-2.0.6 do:
cd <package-path>
./configure --prefix=$PREFIX
make install
* gtkmm-Installation. For each package of libsigc++-1.2.x, gtkmm-2.0.x do:
cd <package-path>
./configure --prefix=$PREFIX
make install
* Verification can easily done by
cd gtkmm-1.2.x/examples
and testing all built executables.
Feel free to contact the gtkmm mailing list in case of problems compiling gtkmm under Sun
Michael v. Szombathely, 31-Oct-02
\ No newline at end of file
Building gtkmm on Win32
Currently, only the mingw (native win32) gcc compiler is supported
through the gnu autotools (automake, autoconf, libtool). As explicitly
stated in the gtk+ for win32 distribution (,
the gcc compiler provided by the cygwin distribution should not be
used to build gtk+/gtkmm libraries and/or applications (see the
README.win32 that comes with the gtk+ DLLs). This MIGHT cause
conflicts between the cygwin and msvcrt runtime environments.
1. Mingw
The mingw distribution which has been tested with this release is the following
MinGW-1.1 as the base distribution plus the update packages :
The bare mingw distribution does not provide the necessary tools (sh, perl, m4
, autoconf, automake, ..) to run the provided configure script "as is". One
(currently non supported) solution is to use mingw in conjunction with msys,
which is readily available on the mingw website (
The preferred method is to combine the cygwin distribution (for the unix tools
that were mentioned above) with mingw by making sure that the mingw
tools (gcc, ld, dlltool, ..) are called first.
First, make sure that you have working distribution of the native port
of both libsigc++-1.1.x gtk+-2.0 on win32 (see If you can't compile a simple gtk+ example
using gcc and `pkg-config --cflags --libs`, you should not even think
about trying to compile gtkmm, let alone using precompiled libgtkmm
DLLs to port your gtkmm application !
The configure script can then be called using (as an example) the
following options
./configure --prefix=/target --build=i386-pc-mingw32 --disable-static
make check
make install
Because Dll support with libtool on the mingw32 platform is fairly recent, it
requires developement version of autoconf/automake and libtool, as provided by
the autotools-devel package in the cygwin distribution. Currently, this means
libtool : 1.4.2
automake : 1.5b
autoconf : 2.52
IMPORTANT WARNING : the libtool scripts contained in the source distribution
of the library might not be recent enough to support dll creation. It will
create a static library instead. The main reason for this situation
comes from the fact that the gnome distribution uses the last stable
releases of the autotools, as opposed to their development (cvs)
versions. Therefore, it is recommended to always checked the version
of libtool that is being used when compiling libsigc++ on win32 by calling
libtool --version
once it has be created by the configure script.
If libtool is too old, it will be necessary to overwrite it using
libtoolize --force
from the cygwin autotools-devel package (usually located on
/usr/autotools/devel), followed by
before running the configure script again.
In the future, a specially tuned source distribution along with a binary
package might be provided for mingw.
3. Oher compilers (MSVC, borland)
While some compiler options are present in sigc++/config/,
other compilers are currently not supported but anyone is free to give it
a try !
This file gives an overview of the status of gtkmm-1.3 development.
done = every item implemented
almost = some stuff commented out for various reasons
partly = there's still a lot of work
- = category doesn't apply here == There are none to wrap.
<empty> = you should probably volunteer to get this done
If it's "almost" or "partly" then there should be a //TODO comment
in the .hg file explaining why.
Class Methods Signals Properties VFuncs Interfaces
Atk::Object done done - -
Atk::Relation - - - -
Atk::RelationSet - - - -
Atk::StateSet - - - -
Class Methods Signals Properties VFuncs Interfaces
Pango::AttrList done - - - -
Pango::Context done - - - -
Pango::Coverage almost - - - -
Pango::Font done - - backend-only -
Pango::FontDescription done - - - -
Pango::FontFace done - - backend-only -
Panfo::FontFamily done - - - -
Pango::FontMap done - - backend-only -
Pango::FontMetrics done - - - -
Pango::FontSet - - - backend-only -
Pango::Layout done - - - -
Pango::LayoutIter done - - - -
Pango::LayoutLine done - - - -
Pango::TabArray almost - - - -
Class Methods Signals Properties VFuncs Interfaces
Gdk::Colormap done - - - -
Gdk::DragContext done - - -
Gdk::Drawable done - - - -
Gdk::GC done - - - -
Gdk::Image done - - - -
Gdk::Pixbuf done - - - -
Gdk::PixbufAnimation done - - - -
Gdk::PixbufAnimationIter done - - - -
Gdk::PixbufLoader done done - - -
Gdk::Visual done - - - -
Gdk::Window done - - - -
Class Methods Signals Properties VFuncs Interfaces
Gtk::AccelGroup done - - - -
Gtk::AccelLabel done - done -
Gtk::Adjustment almost done - -
Gtk::Alignment done - done -
Gtk::Arrow done - done -
Gtk::AspectFrame done - done -
Gtk::Bin done - - -
Gtk::Box done - done -
Gtk::Button done done done -
Gtk::ButtonBox done - done -
Gtk::Calendar done done - -
Gtk::CellEditable - done - done done
Gtk::CellRenderer done - done done -
Gtk::CellRendererPixbuf - - done - -
Gtk::CellRendererText done done done - -
Gtk::CellRendererToggle done done done - -
Gtk::CheckButton done - - done
Gtk::CheckMenuItem done done done done
Gtk::ColorSelection done done - - -
Gtk::ColorSelectionDialog done - - - -
Gtk::Combo done - done -
Gtk::Container done done done done
Gtk::Curve done done done -
Gtk::Dialog almost done done - -
Gtk::DrawingArea - - - - -
Gtk::Editable done done - done done
Gtk::Entry done done done - done
Gtk::EventBox done - - - -
Gtk::FileSelection done - done - -
Gtk::Fixed done - - - -
Gtk::FontSelection done - done - -
Gtk::FontSelectionDialog done - - - -
Class Methods Signals Properties VFuncs Interfaces
Gtk::Frame done - done done -
Gtk::GammaCurve done - - -
Gtk::HandleBox done done done - -
Gtk::HBox - - - - -
Gtk::HButtonBox - - - - -
Gtk::HPaned - - - - -
Gtk::HRuler done - - - -
Gtk::HScale done - - - -
Gtk::HScrollbar done - - - -
Gtk::HSeparator done - - - -
Gtk::HandleBox done done done - -
Gtk::Image done - done - -
Gtk::ImageMenuItem done - - - -
Gtk::Invisible done - - - -
Gtk::IconSet done - - - -
Gtk::IconSource done - - - -
Gtk::Label done done done - -
Gtk::Layout done done done - -
Gtk::ListStore done - - - partly
Gtk::Menu done - done - -
Gtk::MenuBar done - - - -
Gtk::MenuShell done - -
Gtk::MessageDialog done - - - -
Gtk::Misc done - done - -
Gtk::Notebook done done done - -
Gtk::OptionMenu done done done - -
Gtk::Paned done - done - -
Gtk::Pixmap done - - - -
Gtk::Plug done done - - -
Gtk::Progress done - done done -
Gtk::ProgressBar done done done - -
Gtk::RadioButton done - - - -
Gtk::Range done done done done -
Gtk::Ruler done - done done -
Gtk::Scale done almost done done -
Gtk::Scrollbar done - - - -
Gtk::ScrolledWindow done - done - -
Gtk::Separator done - - - -
Gtk::Settings done - done - -
Gtk::SizeGroup done - done - -
Gtk::Socket done done - - -
Gtk::SpinButton done done done - -
Gtk::Statusbar done - - - - -
Class Methods Signals Properties VFuncs Interfaces
Gtk::Style done - - done -
Gtk::Table almost - done - -
Gtk::TextAttributes almost - - - -
Gtk::TextBuffer partly done - - -
Gtk::TextIter done - - - -
Gtk::TextMark done - - - -
Gtk::TextTag done done done - -
Gtk::TextTagTable almost done - - -
Gtk::TextView done done done - -
Gtk::ToggleButton done done done -
Gtk::Toolbar done done done - -
Gtk::TreeDragDest - done - done done
Gtk::TreeDragSource - done - done done
Gtk::TreeModel - done - done done
Gtk::TreePath done - - - -
Gtk::TreeSelection almost done - - -
Gtk::TreeSortable done - done done
Gtk::TreeStore done - - - partly
Gtk::TreeView almost done almost - -
Gtk::TreeViewColumn almost done done - -
Gtk::VBox - - - - -
Gtk::VButtonBox - - - - -
Gtk::VPaned - - - - -
Gtk::VRuler done - - - -
Gtk::VScale done - - - -
Gtk::VScrollbar done - - - -
Gtk::VSeparator done - - - -
Gtk::Viewport done done done - -
Gtk::Widget almost almost done done
Gtk::Window done done done - -
Gtk::WindowGroup done - - - -
#! /bin/sh
srcdir=`dirname $0`
test "x$srcdir" = x && srcdir=.
if test -f "$srcdir/" && \
test -d "$srcdir/gtk/src" && \
test -d "$srcdir/gtk/gtkmm"
then :; else
echo "** Error **: Directory \`${srcdir}\' does not look like"
echo "the top-level ${PKG_NAME} directory."
exit 1
MAKE=`which gnumake`
test -x "$MAKE" || MAKE=`which gmake`
test -x "$MAKE" || MAKE=`which make`
if "$MAKE" --version 2>/dev/null | grep "Free Software Foundation" >/dev/null 2>&1
then :; else
echo "** Error **: You need GNU make to build gtkmm from CVS."
echo "${MAKE} is not GNU make."
exit 1
echo "Found GNU make at ${MAKE}... good."
cd "$srcdir"
echo "Adding libtools."
libtoolize --automake || exit 1
echo "Building macros."
aclocal -I "$srcdir/scripts" $ACLOCAL_FLAGS || exit 1
#echo "Building config header."