Merge branch 'TimePath/gtk++' into 'master'
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 1 Aug 2017 10:51:11 +0000 (10:51 +0000)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 1 Aug 2017 10:51:11 +0000 (10:51 +0000)
GTK Upgrade

See merge request !59

366 files changed:
.drone.yml [new file with mode: 0644]
CMakeLists.txt
Makefile
cmake/FindGLIB.cmake
cmake/FindGTK2.cmake [new file with mode: 0644]
cmake/FindGTK3.cmake [new file with mode: 0644]
cmake/FindGtkGLExt.cmake
cmake/FindMinizip.cmake
cmake/FindPango.cmake [new file with mode: 0644]
contrib/bkgrnd2d/dialog.cpp
contrib/bobtoolz/CMakeLists.txt
contrib/bobtoolz/StdAfx.cpp [deleted file]
contrib/bobtoolz/StdAfx.h [deleted file]
contrib/bobtoolz/bobToolz-GTK.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.cpp
contrib/bobtoolz/dialogs/dialogs-gtk.h
contrib/bobtoolz/lists.cpp
contrib/bobtoolz/lists.h
contrib/bobtoolz/shapes.cpp
contrib/brushexport/callbacks.cpp
contrib/brushexport/callbacks.h
contrib/brushexport/interface.cpp
contrib/brushexport/plugin.cpp
contrib/brushexport/support.cpp
contrib/brushexport/support.h
contrib/camera/camera.h
contrib/camera/dialogs.cpp
contrib/gtkgensurf/gendlgs.cpp
contrib/gtkgensurf/gensurf.cpp
contrib/gtkgensurf/gensurf.h
contrib/gtkgensurf/view.cpp
contrib/hydratoolz/plugin.cpp
contrib/hydratoolz/plugin.h
contrib/prtview/AboutDialog.cpp
contrib/prtview/ConfigDialog.cpp
contrib/prtview/LoadPortalFileDialog.cpp
contrib/shaderplug/shaderplug.cpp
contrib/sunplug/sunplug.cpp
contrib/ufoaiplug/ufoai.cpp
contrib/ufoaiplug/ufoai_gtk.cpp
contrib/ufoaiplug/ufoai_gtk.h
include/CMakeLists.txt
include/cullable.cpp [deleted file]
include/editable.cpp [deleted file]
include/iarchive.cpp [deleted file]
include/ibrush.cpp [deleted file]
include/icamera.cpp [deleted file]
include/idatastream.cpp [deleted file]
include/ieclass.cpp [deleted file]
include/ientity.cpp [deleted file]
include/ifilesystem.cpp [deleted file]
include/ifiletypes.cpp [deleted file]
include/ifilter.cpp [deleted file]
include/igl.cpp [deleted file]
include/iglrender.cpp [deleted file]
include/igtkgl.cpp [deleted file]
include/igtkgl.h
include/iimage.cpp [deleted file]
include/imap.cpp [deleted file]
include/imodel.cpp [deleted file]
include/ipatch.cpp [deleted file]
include/iplugin.cpp [deleted file]
include/ireference.cpp [deleted file]
include/irender.cpp [deleted file]
include/iscenegraph.cpp [deleted file]
include/iscriplib.cpp [deleted file]
include/iselection.cpp [deleted file]
include/ishaders.cpp [deleted file]
include/itexdef.cpp [deleted file]
include/itextstream.cpp [deleted file]
include/itextures.cpp [deleted file]
include/itoolbar.cpp [deleted file]
include/itoolbar.h
include/iundo.cpp [deleted file]
include/mapfile.cpp [deleted file]
include/modelskin.cpp [deleted file]
include/moduleobserver.cpp [deleted file]
include/modulesystem.cpp [deleted file]
include/nameable.cpp [deleted file]
include/namespace.cpp [deleted file]
include/qerplugin.cpp [deleted file]
include/qerplugin.h
include/renderable.cpp [deleted file]
include/selectable.cpp [deleted file]
include/windowobserver.cpp [deleted file]
libs/CMakeLists.txt
libs/_.cpp [new file with mode: 0644]
libs/archivelib.cpp [deleted file]
libs/bytebool.cpp [deleted file]
libs/bytestreamutils.cpp [deleted file]
libs/character.cpp [deleted file]
libs/container/CMakeLists.txt
libs/container/array.h
libs/container/cache.cpp [deleted file]
libs/container/cache.h
libs/container/container.cpp [deleted file]
libs/container/hashfunc.cpp [deleted file]
libs/container/hashtable.h
libs/container/stack.cpp [deleted file]
libs/convert.cpp [deleted file]
libs/debugging/debugging.h
libs/dragplanes.cpp [deleted file]
libs/eclasslib.cpp [deleted file]
libs/entitylib.cpp [deleted file]
libs/entityxml.cpp [deleted file]
libs/fs_filesystem.cpp [deleted file]
libs/fs_path.cpp [deleted file]
libs/generic/CMakeLists.txt
libs/generic/arrayrange.cpp [deleted file]
libs/generic/bitfield.cpp [deleted file]
libs/generic/callbackfwd.cpp [deleted file]
libs/generic/enumeration.cpp [deleted file]
libs/generic/functional.cpp [deleted file]
libs/generic/reference.cpp [deleted file]
libs/generic/referencecounted.cpp [deleted file]
libs/generic/vector.cpp [deleted file]
libs/gtkutil/CMakeLists.txt
libs/gtkutil/accelerator.cpp
libs/gtkutil/accelerator.h
libs/gtkutil/button.cpp
libs/gtkutil/button.h
libs/gtkutil/clipboard.cpp
libs/gtkutil/closure.cpp [deleted file]
libs/gtkutil/container.cpp [deleted file]
libs/gtkutil/container.h
libs/gtkutil/cursor.cpp
libs/gtkutil/cursor.h
libs/gtkutil/dialog.cpp
libs/gtkutil/dialog.h
libs/gtkutil/entry.cpp
libs/gtkutil/entry.h
libs/gtkutil/filechooser.cpp
libs/gtkutil/filechooser.h
libs/gtkutil/frame.cpp
libs/gtkutil/frame.h
libs/gtkutil/glwidget.cpp
libs/gtkutil/glwidget.h
libs/gtkutil/idledraw.cpp [deleted file]
libs/gtkutil/image.cpp
libs/gtkutil/image.h
libs/gtkutil/menu.cpp
libs/gtkutil/menu.h
libs/gtkutil/messagebox.cpp
libs/gtkutil/messagebox.h
libs/gtkutil/nonmodal.cpp
libs/gtkutil/nonmodal.h
libs/gtkutil/paned.cpp
libs/gtkutil/paned.h
libs/gtkutil/pointer.cpp [deleted file]
libs/gtkutil/toolbar.cpp
libs/gtkutil/toolbar.h
libs/gtkutil/widget.cpp
libs/gtkutil/widget.h
libs/gtkutil/window.cpp
libs/gtkutil/window.h
libs/gtkutil/xorrectangle.cpp
libs/gtkutil/xorrectangle.h
libs/imagelib.cpp [deleted file]
libs/instancelib.cpp [deleted file]
libs/maplib.cpp [deleted file]
libs/math/CMakeLists.txt
libs/math/_.cpp [new file with mode: 0644]
libs/math/aabb.cpp [deleted file]
libs/math/curve.cpp [deleted file]
libs/math/frustum.cpp [deleted file]
libs/math/line.cpp [deleted file]
libs/math/matrix.cpp [deleted file]
libs/math/pi.cpp [deleted file]
libs/math/plane.cpp [deleted file]
libs/math/quaternion.cpp [deleted file]
libs/math/vector.cpp [deleted file]
libs/moduleobservers.cpp [deleted file]
libs/modulesystem/CMakeLists.txt
libs/modulesystem/moduleregistry.cpp [deleted file]
libs/modulesystem/moduleregistry.h
libs/modulesystem/modulesmap.cpp [deleted file]
libs/modulesystem/singletonmodule.h
libs/os/CMakeLists.txt
libs/os/_.cpp [new file with mode: 0644]
libs/os/dir.cpp [deleted file]
libs/os/file.cpp [deleted file]
libs/os/path.cpp [deleted file]
libs/pivot.cpp [deleted file]
libs/render.cpp [deleted file]
libs/scenelib.cpp [deleted file]
libs/script/CMakeLists.txt
libs/script/_.cpp [new file with mode: 0644]
libs/script/scripttokeniser.cpp [deleted file]
libs/script/scripttokenwriter.cpp [deleted file]
libs/selectionlib.cpp [deleted file]
libs/shaderlib.cpp [deleted file]
libs/signal/CMakeLists.txt
libs/signal/isignal.cpp [deleted file]
libs/signal/signalfwd.cpp [deleted file]
libs/str.cpp [deleted file]
libs/stream/CMakeLists.txt
libs/stream/_.cpp [new file with mode: 0644]
libs/stream/filestream.cpp [deleted file]
libs/stream/memstream.cpp [deleted file]
libs/stream/stringstream.cpp [deleted file]
libs/stream/textfilestream.cpp [deleted file]
libs/stream/textstream.cpp [deleted file]
libs/string/CMakeLists.txt
libs/string/string.cpp [deleted file]
libs/string/stringfwd.cpp [deleted file]
libs/stringio.cpp [deleted file]
libs/texturelib.cpp [deleted file]
libs/transformlib.cpp [deleted file]
libs/traverselib.cpp [deleted file]
libs/typesystem.cpp [deleted file]
libs/uilib/CMakeLists.txt
libs/uilib/uilib.cpp
libs/uilib/uilib.h [new file with mode: 0644]
libs/undolib.cpp [deleted file]
libs/uniquenames.cpp [deleted file]
libs/versionlib.cpp [deleted file]
libs/xml/CMakeLists.txt
libs/xml/ixml.cpp [deleted file]
libs/xml/xmlelement.cpp [deleted file]
libs/xml/xmlparser.cpp [deleted file]
libs/xml/xmlwriter.cpp [deleted file]
plugins/archivepak/CMakeLists.txt
plugins/archivepak/archive.cpp
plugins/archivepak/pak.cpp [deleted file]
plugins/archivepak/plugin.cpp
plugins/archivepak/plugin.h [deleted file]
plugins/archivewad/CMakeLists.txt
plugins/archivewad/archive.cpp
plugins/archivewad/plugin.cpp
plugins/archivewad/plugin.h [deleted file]
plugins/archivewad/wad.cpp [deleted file]
plugins/archivezip/CMakeLists.txt
plugins/archivezip/pkzip.cpp [deleted file]
plugins/archivezip/plugin.cpp
plugins/archivezip/plugin.h [deleted file]
plugins/archivezip/zlibstream.cpp [deleted file]
plugins/entity/CMakeLists.txt
plugins/entity/angle.cpp [deleted file]
plugins/entity/angles.cpp [deleted file]
plugins/entity/colour.cpp [deleted file]
plugins/entity/curve.cpp [deleted file]
plugins/entity/keyobservers.cpp [deleted file]
plugins/entity/model.cpp [deleted file]
plugins/entity/modelskinkey.cpp [deleted file]
plugins/entity/namedentity.cpp [deleted file]
plugins/entity/namekeys.cpp [deleted file]
plugins/entity/origin.cpp [deleted file]
plugins/entity/plugin.cpp
plugins/entity/plugin.h [deleted file]
plugins/entity/rotation.cpp [deleted file]
plugins/entity/scale.cpp [deleted file]
plugins/image/CMakeLists.txt
plugins/image/image.cpp
plugins/image/image.h [deleted file]
plugins/imagehl/CMakeLists.txt
plugins/imagehl/imagehl.cpp
plugins/imagehl/imagehl.h [deleted file]
plugins/imagepng/CMakeLists.txt
plugins/imagepng/plugin.cpp
plugins/imagepng/plugin.h [deleted file]
plugins/imageq2/CMakeLists.txt
plugins/imageq2/imageq2.cpp
plugins/imageq2/imageq2.h [deleted file]
plugins/mapq3/CMakeLists.txt
plugins/mapq3/plugin.cpp
plugins/mapq3/plugin.h [deleted file]
plugins/mapxml/CMakeLists.txt
plugins/mapxml/plugin.cpp
plugins/mapxml/plugin.h [deleted file]
plugins/md3model/CMakeLists.txt
plugins/md3model/md3normals.cpp [deleted file]
plugins/md3model/mdlformat.cpp [deleted file]
plugins/md3model/mdlnormals.cpp [deleted file]
plugins/md3model/model.cpp [deleted file]
plugins/md3model/plugin.cpp
plugins/md3model/plugin.h [deleted file]
plugins/model/CMakeLists.txt
plugins/model/plugin.cpp
plugins/model/plugin.h [deleted file]
plugins/sample/sample.h [deleted file]
plugins/shaders/CMakeLists.txt
plugins/shaders/plugin.cpp
plugins/shaders/plugin.h [deleted file]
plugins/textool/2DView.cpp
plugins/textool/StdAfx.cpp [deleted file]
plugins/textool/StdAfx.h
plugins/textool/TexTool.cpp
plugins/vfspk3/CMakeLists.txt
plugins/vfspk3/archive.cpp
plugins/vfspk3/vfspk3.cpp
plugins/vfspk3/vfspk3.h [deleted file]
radiant/CMakeLists.txt
radiant/autosave.cpp
radiant/brushmanip.cpp
radiant/brushmanip.h
radiant/build.cpp
radiant/build.h
radiant/camwindow.cpp
radiant/camwindow.h
radiant/commands.cpp
radiant/console.cpp
radiant/console.h
radiant/dialog.cpp
radiant/dialog.h
radiant/entity.cpp
radiant/entity.h
radiant/entityinspector.cpp
radiant/entityinspector.h
radiant/entitylist.cpp
radiant/entitylist.h
radiant/feedback.cpp
radiant/feedback.h
radiant/filters.cpp
radiant/filters.h
radiant/findtexturedialog.cpp
radiant/findtexturedialog.h
radiant/grid.cpp
radiant/grid.h
radiant/groupdialog.cpp
radiant/groupdialog.h
radiant/gtkdlgs.cpp
radiant/gtkmisc.cpp
radiant/gtkmisc.h
radiant/help.cpp
radiant/help.h
radiant/main.cpp
radiant/mainframe.cpp
radiant/mainframe.h
radiant/map.cpp
radiant/mru.cpp
radiant/mru.h
radiant/multimon.cpp
radiant/patchdialog.cpp
radiant/patchdialog.h
radiant/patchmanip.cpp
radiant/patchmanip.h
radiant/pluginmanager.cpp
radiant/pluginmanager.h
radiant/pluginmenu.cpp
radiant/pluginmenu.h
radiant/plugintoolbar.cpp
radiant/plugintoolbar.h
radiant/preferences.cpp
radiant/preferences.h
radiant/qe3.cpp
radiant/qgl.cpp
radiant/select.cpp
radiant/server.cpp
radiant/surfacedialog.cpp
radiant/surfacedialog.h
radiant/textureentry.cpp
radiant/textureentry.h
radiant/texwindow.cpp
radiant/texwindow.h
radiant/treemodel.cpp
radiant/url.cpp
radiant/watchbsp.cpp
radiant/windowobservers.cpp
radiant/windowobservers.h
radiant/xmlstuff.h
radiant/xywindow.cpp
radiant/xywindow.h
tools/quake3/common/vfs.c
tools/quake3/common/vfs.h
tools/quake3/q3map2/lightmaps_ydnar.c
tools/quake3/q3map2/main.c

diff --git a/.drone.yml b/.drone.yml
new file mode 100644 (file)
index 0000000..d40dd2e
--- /dev/null
@@ -0,0 +1,8 @@
+build:
+  image: teaci/msys32
+  shell: mingw32
+  pull: true
+  commands:
+    - pacman -S --needed --noconfirm --noprogressbar mingw-w64-i686-{toolchain,cmake,gtk2,gtkglext}
+    - cmake -G "MSYS Makefiles" .
+    - make
index 9af79ce939b166be728dac4e37d5b5698db99ce8..b2b766ea6ca8a636519f766e71669d4d64fccfde 100644 (file)
@@ -72,7 +72,8 @@ if (NOT WIN32)
 endif ()
 
 set(CMAKE_POSITION_INDEPENDENT_CODE 1)
-set(GTK_NS "GTK2" CACHE STRING "GTK variable prefix")
+set(GTK_TARGET 2 CACHE STRING "GTK target")
+add_definitions(-DGTK_TARGET=${GTK_TARGET})
 
 #-----------------------------------------------------------------------
 # Defs
@@ -89,6 +90,20 @@ if (NOT CMAKE_BUILD_TYPE MATCHES Release)
     add_definitions(-D_DEBUG=1)
 endif ()
 
+macro(disable_deprecated name gtk2only)
+    add_definitions(-D${name}_DISABLE_SINGLE_INCLUDES)
+    if ((${gtk2only} EQUAL 0) OR (GTK_TARGET EQUAL 2))
+        add_definitions(-D${name}_DISABLE_DEPRECATED)
+    endif ()
+endmacro()
+
+disable_deprecated(ATK 0)
+disable_deprecated(G 0)
+disable_deprecated(GDK 0)
+disable_deprecated(GDK_PIXBUF 0)
+disable_deprecated(GTK 1)
+disable_deprecated(PANGO 0)
+
 if (APPLE)
     option(XWINDOWS "Build against X11" ON)
     add_definitions(
index fddd00491209ec9416a92fba803a034459d72692..0a2d4b9711e82c0c466da40e1af62455567c7c5e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -113,7 +113,7 @@ CFLAGS_COMMON = -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fn
 CPPFLAGS_COMMON =
 LDFLAGS_COMMON =
 LIBS_COMMON =
-CXXFLAGS_COMMON = -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti
+CXXFLAGS_COMMON = -std=c++11 -Wno-non-virtual-dtor -Wreorder -fno-exceptions -fno-rtti
 
 ifeq ($(BUILD),debug)
 ifeq ($(findstring $(CFLAGS),-g),)
@@ -258,6 +258,7 @@ ifneq ($(GIT_VERSION),)
 endif
 
 CPPFLAGS += -DRADIANT_VERSION="\"$(RADIANT_VERSION)\"" -DRADIANT_MAJOR_VERSION="\"$(RADIANT_MAJOR_VERSION)\"" -DRADIANT_MINOR_VERSION="\"$(RADIANT_MINOR_VERSION)\"" -DRADIANT_PATCH_VERSION="\"$(RADIANT_PATCH_VERSION)\"" -DRADIANT_ABOUTMSG="\"$(RADIANT_ABOUTMSG)\"" -DQ3MAP_VERSION="\"$(Q3MAP_VERSION)\"" -DRADIANT_EXECUTABLE="\"$(RADIANT_EXECUTABLE)\""
+CPPFLAGS += -DGTK_TARGET=2
 
 .PHONY: all
 all: \
@@ -697,6 +698,7 @@ $(INSTALLDIR)/radiant.$(EXE): \
        radiant/stacktrace.o \
        radiant/surfacedialog.o \
        radiant/texmanip.o \
+       radiant/textureentry.o \
        radiant/textures.o \
        radiant/texwindow.o \
        radiant/timer.o \
@@ -711,6 +713,7 @@ $(INSTALLDIR)/radiant.$(EXE): \
        radiant/xywindow.o \
        libcmdlib.$(A) \
        libgtkutil.$(A) \
+       libuilib.$(A) \
        libl_net.$(A) \
        libmathlib.$(A) \
        libprofile.$(A) \
@@ -735,8 +738,6 @@ libgtkutil.$(A): \
        libs/gtkutil/accelerator.o \
        libs/gtkutil/button.o \
        libs/gtkutil/clipboard.o \
-       libs/gtkutil/closure.o \
-       libs/gtkutil/container.o \
        libs/gtkutil/cursor.o \
        libs/gtkutil/dialog.o \
        libs/gtkutil/entry.o \
@@ -744,51 +745,42 @@ libgtkutil.$(A): \
        libs/gtkutil/frame.o \
        libs/gtkutil/glfont.o \
        libs/gtkutil/glwidget.o \
-       libs/gtkutil/idledraw.o \
        libs/gtkutil/image.o \
        libs/gtkutil/menu.o \
        libs/gtkutil/messagebox.o \
        libs/gtkutil/nonmodal.o \
        libs/gtkutil/paned.o \
-       libs/gtkutil/pointer.o \
        libs/gtkutil/toolbar.o \
        libs/gtkutil/widget.o \
        libs/gtkutil/window.o \
        libs/gtkutil/xorrectangle.o \
 
+libuilib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) $(CPPFLAGS_GTK) $(CPPFLAGS_GTKGLEXT) -Ilibs -Iinclude
+libuilib.$(A): \
+       libs/uilib/uilib.o \
+
 libxmllib.$(A): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) -Ilibs -Iinclude
 libxmllib.$(A): \
-       libs/xml/ixml.o \
-       libs/xml/xmlelement.o \
-       libs/xml/xmlparser.o \
        libs/xml/xmltextags.o \
-       libs/xml/xmlwriter.o \
 
 $(INSTALLDIR)/modules/archivezip.$(DLL): LIBS_EXTRA := $(LIBS_ZLIB)
 $(INSTALLDIR)/modules/archivezip.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_ZLIB) -Ilibs -Iinclude
 $(INSTALLDIR)/modules/archivezip.$(DLL): \
        plugins/archivezip/archive.o \
-       plugins/archivezip/pkzip.o \
        plugins/archivezip/plugin.o \
-       plugins/archivezip/zlibstream.o \
 
 $(INSTALLDIR)/modules/archivewad.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
 $(INSTALLDIR)/modules/archivewad.$(DLL): \
        plugins/archivewad/archive.o \
        plugins/archivewad/plugin.o \
-       plugins/archivewad/wad.o \
 
 $(INSTALLDIR)/modules/archivepak.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
 $(INSTALLDIR)/modules/archivepak.$(DLL): \
        plugins/archivepak/archive.o \
-       plugins/archivepak/pak.o \
        plugins/archivepak/plugin.o \
 
-$(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
+$(INSTALLDIR)/modules/entity.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
 $(INSTALLDIR)/modules/entity.$(DLL): \
-       plugins/entity/angle.o \
-       plugins/entity/angles.o \
-       plugins/entity/colour.o \
        plugins/entity/doom3group.o \
        plugins/entity/eclassmodel.o \
        plugins/entity/entity.o \
@@ -797,13 +789,7 @@ $(INSTALLDIR)/modules/entity.$(DLL): \
        plugins/entity/group.o \
        plugins/entity/light.o \
        plugins/entity/miscmodel.o \
-       plugins/entity/model.o \
-       plugins/entity/modelskinkey.o \
-       plugins/entity/namedentity.o \
-       plugins/entity/origin.o \
        plugins/entity/plugin.o \
-       plugins/entity/rotation.o \
-       plugins/entity/scale.o \
        plugins/entity/skincache.o \
        plugins/entity/targetable.o \
 
@@ -838,7 +824,7 @@ $(INSTALLDIR)/modules/imagepng.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_PNG) -Ilibs
 $(INSTALLDIR)/modules/imagepng.$(DLL): \
        plugins/imagepng/plugin.o \
 
-$(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := -Ilibs -Iinclude
+$(INSTALLDIR)/modules/mapq3.$(DLL): CPPFLAGS_EXTRA := $(CPPFLAGS_GLIB) -Ilibs -Iinclude
 $(INSTALLDIR)/modules/mapq3.$(DLL): \
        plugins/mapq3/parse.o \
        plugins/mapq3/plugin.o \
index 092bdc863abb4f19fa0699674d91b0a8aef35f0f..4b1b26504b27c0ee2beb6b1aea50f2a1619a22f2 100644 (file)
@@ -1,9 +1,21 @@
-include(FindPkgConfig)
+find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
     if (GLIB_FIND_REQUIRED)
-        set(_PACKAGE_ARGS REQUIRED)
-    else ()
-        set(_PACKAGE_ARGS "")
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(GLIB ${_pkgconfig_REQUIRED} glib-2.0)
+else ()
+    find_path(GLIB_INCLUDE_DIRS glib.h)
+    find_library(GLIB_LIBRARIES glib-2.0)
+    if (GLIB_INCLUDE_DIRS AND GLIB_LIBRARIES)
+        set(GLIB_FOUND 1)
+        if (NOT GLIB_FIND_QUIETLY)
+            message(STATUS "Found GLIB: ${GLIB_LIBRARIES}")
+        endif ()
+    elseif (GLIB_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GLIB")
+    elseif (NOT GLIB_FIND_QUIETLY)
+        message(STATUS "Could not find GLIB")
     endif ()
-    pkg_check_modules(GLIB glib-2.0 ${_PACKAGE_ARGS})
 endif ()
+mark_as_advanced(GLIB_INCLUDE_DIRS GLIB_LIBRARIES)
diff --git a/cmake/FindGTK2.cmake b/cmake/FindGTK2.cmake
new file mode 100644 (file)
index 0000000..ff20526
--- /dev/null
@@ -0,0 +1,21 @@
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+    if (GTK2_FIND_REQUIRED)
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(GTK2 ${_pkgconfig_REQUIRED} gtk+-2.0)
+else ()
+    find_path(GTK2_INCLUDE_DIRS gtk.h)
+    # find_library(GTK2_LIBRARIES)
+    if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
+        set(GTK2_FOUND 1)
+        if (NOT GTK2_FIND_QUIETLY)
+            message(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
+        endif ()
+    elseif (GTK2_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GTK2")
+    elseif (NOT GTK2_FIND_QUIETLY)
+        message(STATUS "Could not find GTK2")
+    endif ()
+endif ()
+mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES)
diff --git a/cmake/FindGTK3.cmake b/cmake/FindGTK3.cmake
new file mode 100644 (file)
index 0000000..7bef3b0
--- /dev/null
@@ -0,0 +1,21 @@
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+    if (GTK3_FIND_REQUIRED)
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(GTK3 ${_pkgconfig_REQUIRED} gtk+-3.0)
+else ()
+    find_path(GTK3_INCLUDE_DIRS gtk.h)
+    # find_library(GTK3_LIBRARIES)
+    if (GTK3_INCLUDE_DIRS AND GTK3_LIBRARIES)
+        set(GTK3_FOUND 1)
+        if (NOT GTK3_FIND_QUIETLY)
+            message(STATUS "Found GTK3: ${GTK3_LIBRARIES}")
+        endif ()
+    elseif (GTK3_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GTK3")
+    elseif (NOT GTK3_FIND_QUIETLY)
+        message(STATUS "Could not find GTK3")
+    endif ()
+endif ()
+mark_as_advanced(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)
index 7fb3e9d1bfef83e502aa4769e12522e76326d012..b30a1e1185fe57a11b891f277bccba0df94f0bfb 100644 (file)
@@ -1,16 +1,27 @@
-include(FindPkgConfig)
+find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
     if (GtkGLExt_FIND_REQUIRED)
-        set(_PACKAGE_ARGS REQUIRED)
-    else ()
-        set(_PACKAGE_ARGS "")
+        set(_pkgconfig_REQUIRED REQUIRED)
     endif ()
-    pkg_check_modules(GTK gtk+-2.0 ${_PACKAGE_ARGS})
     if (XWINDOWS)
-        pkg_check_modules(GTKGL gtkglext-x11-1.0 ${_PACKAGE_ARGS})
+        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-x11-1.0)
     elseif (WIN32)
-        pkg_check_modules(GTKGL gtkglext-win32-1.0 ${_PACKAGE_ARGS})
+        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-win32-1.0)
     else ()
-        pkg_check_modules(GTKGL gtkglext-quartz-1.0 ${_PACKAGE_ARGS})
+        pkg_check_modules(GtkGLExt ${_pkgconfig_REQUIRED} gtkglext-quartz-1.0)
+    endif ()
+else ()
+    find_path(GtkGLExt_INCLUDE_DIRS gtkglwidget.h)
+    # find_library(GtkGLExt_LIBRARIES)
+    if (GtkGLExt_INCLUDE_DIRS AND GtkGLExt_LIBRARIES)
+        set(GtkGLExt_FOUND 1)
+        if (NOT GtkGLExt_FIND_QUIETLY)
+            message(STATUS "Found GtkGLExt: ${GtkGLExt_LIBRARIES}")
+        endif ()
+    elseif (GtkGLExt_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find GtkGLExt")
+    elseif (NOT GtkGLExt_FIND_QUIETLY)
+        message(STATUS "Could not find GtkGLExt")
     endif ()
 endif ()
+mark_as_advanced(GtkGLExt_INCLUDE_DIRS GtkGLExt_LIBRARIES)
index 10a5fc6f98b43d616bd10c34b961ba149e44720e..0de098f438fb258aba1d66bf397cb802e660db09 100644 (file)
@@ -1,9 +1,21 @@
-include(FindPkgConfig)
+find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
     if (Minizip_FIND_REQUIRED)
-        set(_PACKAGE_ARGS REQUIRED)
-    else ()
-        set(_PACKAGE_ARGS "")
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_check_modules(Minizip ${_pkgconfig_REQUIRED} minizip)
+else ()
+    find_path(Minizip_INCLUDE_DIRS unzip.h)
+    # find_library(Minizip_LIBRARIES)
+    if (Minizip_INCLUDE_DIRS AND Minizip_LIBRARIES)
+        set(Minizip_FOUND 1)
+        if (NOT Minizip_FIND_QUIETLY)
+            message(STATUS "Found Minizip: ${Minizip_LIBRARIES}")
+        endif ()
+    elseif (Minizip_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find Minizip")
+    elseif (NOT Minizip_FIND_QUIETLY)
+        message(STATUS "Could not find Minizip")
     endif ()
-    pkg_check_modules(Minizip minizip ${_PACKAGE_ARGS})
 endif ()
+mark_as_advanced(Minizip_INCLUDE_DIRS Minizip_LIBRARIES)
diff --git a/cmake/FindPango.cmake b/cmake/FindPango.cmake
new file mode 100644 (file)
index 0000000..67359ef
--- /dev/null
@@ -0,0 +1,23 @@
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+    if (Pango_FIND_REQUIRED)
+        set(_pkgconfig_REQUIRED REQUIRED)
+    endif ()
+    pkg_search_module(Pango ${_pkgconfig_REQUIRED} pango pangocairo)
+    pkg_search_module(PangoFT2 ${_pkgconfig_REQUIRED} pangoft2)
+else ()
+    # find_path(Pango_INCLUDE_DIRS)
+    # find_library(Pango_LIBRARIES)
+    if (Pango_INCLUDE_DIRS AND Pango_LIBRARIES)
+        set(Pango_FOUND 1)
+        if (NOT Pango_FIND_QUIETLY)
+            message(STATUS "Found Pango: ${Pango_LIBRARIES}")
+        endif ()
+    elseif (Pango_FIND_REQUIRED)
+        message(SEND_ERROR "Could not find Pango")
+    elseif (NOT Pango_FIND_QUIETLY)
+        message(STATUS "Could not find Pango")
+    endif ()
+endif ()
+mark_as_advanced(Pango_INCLUDE_DIRS Pango_LIBRARIES)
+mark_as_advanced(PangoFT2_INCLUDE_DIRS PangoFT2_LIBRARIES)
index 6d63bc3fd80e8cba0bb60ddd484088da45f470bb..f66fb6fba5c097a1422b6bb1884220f4f1ce0a6c 100644 (file)
@@ -172,8 +172,6 @@ void CBackgroundDialogPage::SetPosLabel(){
 }
 
 CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){
-       GtkWidget *frame;
-       GtkWidget *hbox;
        GtkWidget *w;
 
        m_vt = vt;
@@ -183,47 +181,45 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){
        switch ( m_vt )
        {
        case XY:
-               m_pTabLabel = gtk_label_new( "X/Y" );
+               m_pTabLabel = ui::Label( "X/Y" );
                m_pImage = &backgroundXY;
                break;
        case XZ:
-               m_pTabLabel = gtk_label_new( "X/Z" );
+               m_pTabLabel = ui::Label( "X/Z" );
                m_pImage = &backgroundXZ;
                break;
        case YZ:
-               m_pTabLabel = gtk_label_new( "Y/Z" );
+               m_pTabLabel = ui::Label( "Y/Z" );
                m_pImage = &backgroundYZ;
                break;
        }
 // A vbox to hold everything
-       m_pWidget = gtk_vbox_new( FALSE,0 );
+       m_pWidget = ui::VBox( FALSE,0 );
 // Frame for file row
-       frame = gtk_frame_new( "File" );
+       auto frame = ui::Frame( "File" );
        gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 );
 
 // hbox for first row
-       hbox = gtk_hbox_new( FALSE,5 );
+       auto hbox = ui::HBox( FALSE,5 );
        gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 );
-       gtk_container_add( GTK_CONTAINER( frame ), hbox );
+       frame.add(hbox);
 
 // label to display filename
-       m_pFileLabel  = gtk_label_new( NO_FILE_MSG );
+       m_pFileLabel  = ui::Label( NO_FILE_MSG );
        gtk_label_set_selectable( GTK_LABEL( m_pFileLabel ),TRUE );
 //TODO set min size ? done with spaces right now
        gtk_box_pack_start( GTK_BOX( hbox ),m_pFileLabel, TRUE, TRUE, 5 );
 
        gtk_widget_show( m_pFileLabel );
 
-       w = gtk_button_new_with_label( "Browse..." );
-       g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( browse_callback ),
-                                         ( gpointer ) this );
+       w = ui::Button( "Browse..." );
+       w.connect( "clicked", G_CALLBACK( browse_callback ), ( gpointer ) this );
        gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
        gtk_tooltips_set_tip( pTooltips, w, "Select a file", NULL );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Reload" );
-       g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( reload_callback ),
-                                         ( gpointer ) this );
+       w = ui::Button( "Reload" );
+       w.connect( "clicked", G_CALLBACK( reload_callback ), ( gpointer ) this );
        // TODO disable until we have file
        // gtk_widget_set_sensitive(w,FALSE);
        gtk_tooltips_set_tip( pTooltips, w, "Reload current file", NULL );
@@ -234,22 +230,21 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){
        gtk_widget_show( frame );
 
 // second row (rendering options)
-       frame = gtk_frame_new( "Rendering" );
+       frame = ui::Frame( "Rendering" );
        gtk_box_pack_start( GTK_BOX( m_pWidget ),frame, FALSE, FALSE, 2 );
 
-       hbox = gtk_hbox_new( FALSE,5 );
+       hbox = ui::HBox( FALSE,5 );
        gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 );
-       gtk_container_add( GTK_CONTAINER( frame ), hbox );
+       frame.add(hbox);
 
-       w = gtk_label_new( "Vertex alpha:" );
+       w = ui::Label( "Vertex alpha:" );
        gtk_box_pack_start( GTK_BOX( hbox ),w, FALSE, FALSE, 5 );
        gtk_widget_show( w );
 
-       w = gtk_hscale_new_with_range( 0.0,1.0,0.01 );
+       w = ui::HScale( 0.0, 1.0, 0.01 );
        gtk_range_set_value( GTK_RANGE( w ),0.5 );
        gtk_scale_set_value_pos( GTK_SCALE( w ),GTK_POS_LEFT );
-       g_signal_connect( G_OBJECT( w ), "value-changed",
-                                         G_CALLBACK( alpha_adjust_callback ), ( gpointer ) this );
+       w.connect( "value-changed", G_CALLBACK( alpha_adjust_callback ), ( gpointer ) this );
        gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, TRUE, 5 );
        gtk_tooltips_set_tip( pTooltips, w, "Set image transparancy", NULL );
        gtk_widget_show( w );
@@ -257,26 +252,24 @@ CBackgroundDialogPage::CBackgroundDialogPage( VIEWTYPE vt ){
        gtk_widget_show( hbox );
        gtk_widget_show( frame );
 // Third row (size and position)
-       frame = gtk_frame_new( "Size/Position (undefined)" );
+       frame = ui::Frame( "Size/Position (undefined)" );
        m_pPosLabel = gtk_frame_get_label_widget( GTK_FRAME( frame ) );
        gtk_box_pack_start( GTK_BOX( m_pWidget ), frame, FALSE, FALSE, 2 );
 
-       hbox = gtk_hbox_new( FALSE,5 );
-       gtk_container_add( GTK_CONTAINER( frame ), hbox );
+       hbox = ui::HBox( FALSE,5 );
+       frame.add(hbox);
        gtk_container_set_border_width( GTK_CONTAINER( hbox ),4 );
 
-       w = gtk_button_new_with_label( "from selection" );
+       w = ui::Button( "from selection" );
        gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 5 );
-       g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_sel_callback ),
-                                         ( gpointer ) this );
+       w.connect( "clicked", G_CALLBACK( size_sel_callback ), ( gpointer ) this );
        gtk_tooltips_set_tip( pTooltips, w, "Set the size of the image to the bounding rectangle of all selected brushes and entities", NULL );
        gtk_widget_show( w );
 
        if ( m_vt == XY ) {
-               w = gtk_button_new_with_label( "from map mins/maxs" );
+               w = ui::Button( "from map mins/maxs" );
                gtk_box_pack_start( GTK_BOX( hbox ),w, TRUE, FALSE, 2 );
-               g_signal_connect( G_OBJECT( w ), "clicked", G_CALLBACK( size_mm_callback ),
-                                                 ( gpointer ) this );
+               w.connect( "clicked", G_CALLBACK( size_mm_callback ), ( gpointer ) this );
                gtk_tooltips_set_tip( pTooltips, w, "Set the size of the image using the mapcoordsmins and mapcoordsmaxs keys of the worldspawn entity", NULL );
                gtk_widget_show( w );
        }
@@ -320,11 +313,9 @@ void InitBackgroundDialog(){
                                                  //                                                                              GTK_STOCK_CLOSE,
                                                  //                                                                              GTK_RESPONSE_CLOSE,
                                                                                          NULL );
-       gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "delete_event",
-                                               GTK_SIGNAL_FUNC( close_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( pDialogWnd ), "response",
-                                               GTK_SIGNAL_FUNC( response_callback ), NULL );
-//  gtk_signal_connect( GTK_OBJECT (pDialogWnd), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL );
+       pDialogWnd.connect( "delete_event", G_CALLBACK( close_callback ), NULL );
+       pDialogWnd.connect( "response", G_CALLBACK( response_callback ), NULL );
+//  pDialogWnd.connect( "expose_event", G_CALLBACK( ci_expose ), NULL );
 
        pTooltips = gtk_tooltips_new();
 
index fb6f7fb0ad4379d0bddef9acf046b3d4e2d37f06..c9b83cb74e68326dfc7863cb13f4943435f6be2b 100644 (file)
@@ -26,7 +26,6 @@ radiant_plugin(bobtoolz
         resource-gtk.h
         ScriptParser.cpp ScriptParser.h
         shapes.cpp shapes.h
-        StdAfx.cpp StdAfx.h
         visfind.cpp visfind.h
         )
 
diff --git a/contrib/bobtoolz/StdAfx.cpp b/contrib/bobtoolz/StdAfx.cpp
deleted file mode 100644 (file)
index 5c7495f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
-   BobToolz plugin for GtkRadiant
-   Copyright (C) 2001 Gordon Biggans
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-// stdafx.cpp : source file that includes just the standard includes
-//     plugin.pch will be the pre-compiled header
-//     stdafx.obj will contain the pre-compiled type information
-
-#include "StdAfx.h"
diff --git a/contrib/bobtoolz/StdAfx.h b/contrib/bobtoolz/StdAfx.h
deleted file mode 100644 (file)
index cfce5a4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-   BobToolz plugin for GtkRadiant
-   Copyright (C) 2001 Gordon Biggans
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef __STDAFX_BOBTOOLZ__
-#define __STDAFX_BOBTOOLZ__
-
-
-
-#endif
index 4eecfd92d5b210538188b3e91190826babe90f39..6cf91a0be9947d868d0ab628105e0fa95f2a38e8 100644 (file)
@@ -63,7 +63,7 @@ char* PLUGIN_NAME = "bobToolz";
 static char* PLUGIN_COMMANDS = "About...,-,Reset Textures...,PitOMatic,-,Vis Viewer,Brush Cleanup,Polygon Builder,Caulk Selection,-,Tree Planter,Drop Entity,Plot Splines,-,Merge Patches,Split patches,Split patches cols,Split patches rows,Turn edge";
 
 // globals
-GtkWidget *g_pRadiantWnd = NULL;
+ui::Widget g_pRadiantWnd;
 
 static const char *PLUGIN_ABOUT =   "bobToolz for SDRadiant\n"
                                                                        "by digibob (digibob@splashdamage.com)\n"
@@ -72,7 +72,7 @@ static const char *PLUGIN_ABOUT =   "bobToolz for SDRadiant\n"
                                                                        "MarsMattel, RR2DO2\n";
 
 extern "C" const char* QERPlug_Init( void* hApp, void* pMainWidget ) {
-       g_pRadiantWnd = (GtkWidget*)pMainWidget;
+       g_pRadiantWnd = ui::Widget::from(pMainWidget);
 
        return "bobToolz for GTKradiant";
 }
index b596f0591a846ec8c50575818221155fcbdb6fbf..41e4d410622904bed2625cdfaeb4b645cff2793d 100644 (file)
    ---------------------------------*/
 
 typedef struct {
-       GtkWidget *cbTexChange;
-       GtkWidget *editTexOld, *editTexNew;
+       ui::Widget cbTexChange;
+       ui::Widget editTexOld, editTexNew;
 
-       GtkWidget *cbScaleHor, *cbScaleVert;
-       GtkWidget *editScaleHor, *editScaleVert;
+       ui::Widget cbScaleHor, cbScaleVert;
+       ui::Widget editScaleHor, editScaleVert;
 
-       GtkWidget *cbShiftHor, *cbShiftVert;
-       GtkWidget *editShiftHor, *editShiftVert;
+       ui::Widget cbShiftHor, cbShiftVert;
+       ui::Widget editShiftHor, editShiftVert;
 
-       GtkWidget *cbRotation;
-       GtkWidget *editRotation;
+       ui::Widget cbRotation;
+       ui::Widget editRotation;
 }dlg_texReset_t;
 
 dlg_texReset_t dlgTexReset;
@@ -59,23 +59,23 @@ void Update_TextureReseter(){
        gboolean check;
 
        check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbTexChange ) );
-       gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexNew ), check );
-       gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editTexOld ), check );
+       gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexNew ), check );
+       gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editTexOld ), check );
 
        check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleHor ) );
-       gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleHor ), check );
+       gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleHor ), check );
 
        check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbScaleVert ) );
-       gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editScaleVert ), check );
+       gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editScaleVert ), check );
 
        check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftHor ) );
-       gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftHor ), check );
+       gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftHor ), check );
 
        check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbShiftVert ) );
-       gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editShiftVert ), check );
+       gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editShiftVert ), check );
 
        check = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( dlgTexReset.cbRotation ) );
-       gtk_entry_set_editable( GTK_ENTRY( dlgTexReset.editRotation ), check );
+       gtk_editable_set_editable( GTK_EDITABLE( dlgTexReset.editRotation ), check );
 }
 
 static void dialog_button_callback( GtkWidget *widget, gpointer data ){
@@ -105,9 +105,9 @@ static void dialog_button_callback_settex( GtkWidget *widget, gpointer data ){
        TwinWidget* tw = (TwinWidget*)data;
 
        GtkEntry* entry = GTK_ENTRY( tw->one );
-       GtkCombo* combo = GTK_COMBO( tw->two );
+       auto* combo = GTK_BIN(tw->two);
 
-       const gchar* tex = gtk_entry_get_text( GTK_ENTRY( combo->entry ) );
+       const gchar *tex = gtk_entry_get_text(GTK_ENTRY (gtk_bin_get_child(combo)));
        gtk_entry_set_text( entry, tex );
 }
 
@@ -209,100 +209,90 @@ bool ValidateTextInt( const char* pData, char* error_title, int* value ){
  */
 
 EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMessageBoxType type ){
-       GtkWidget *window, *w, *vbox, *hbox;
+       ui::Widget w, vbox, hbox;
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event",
-                                               GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy",
-                                               GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       auto window = ui::Window( ui::window_type::TOP );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
        gtk_window_set_title( GTK_WINDOW( window ), lpCaption );
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
        gtk_widget_realize( window );
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
+       vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
        gtk_widget_show( vbox );
 
-       w = gtk_label_new( lpText );
+       w = ui::Label( lpText );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 );
        gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
        gtk_widget_show( w );
 
-       w = gtk_hseparator_new();
+       w = ui::Widget(gtk_hseparator_new());
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 );
        gtk_widget_show( w );
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        if ( type == eMB_OK ) {
-               w = gtk_button_new_with_label( "Ok" );
+               w = ui::Button( "Ok" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+               gtk_widget_set_can_default(w, true);
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
                ret = eIDOK;
        }
        else if ( type ==  eMB_OKCANCEL ) {
-               w = gtk_button_new_with_label( "Ok" );
+               w = ui::Button( "Ok" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
-               w = gtk_button_new_with_label( "Cancel" );
+               w = ui::Button( "Cancel" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
                gtk_widget_show( w );
                ret = eIDCANCEL;
        }
        else if ( type == eMB_YESNOCANCEL ) {
-               w = gtk_button_new_with_label( "Yes" );
+               w = ui::Button( "Yes" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
-               w = gtk_button_new_with_label( "No" );
+               w = ui::Button( "No" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
                gtk_widget_show( w );
 
-               w = gtk_button_new_with_label( "Cancel" );
+               w = ui::Button( "Cancel" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
                gtk_widget_show( w );
                ret = eIDCANCEL;
        }
        else /* if (mode == MB_YESNO) */
        {
-               w = gtk_button_new_with_label( "Yes" );
+               w = ui::Button( "Yes" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
-               GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+               gtk_widget_set_can_default( w, true );
                gtk_widget_grab_default( w );
                gtk_widget_show( w );
 
-               w = gtk_button_new_with_label( "No" );
+               w = ui::Button( "No" );
                gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-               gtk_signal_connect( GTK_OBJECT( w ), "clicked",
-                                                       GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+               w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
                gtk_widget_show( w );
                ret = eIDNO;
        }
@@ -321,19 +311,18 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess
 }
 
 EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
-       GtkWidget *window, *w, *vbox, *hbox;
-       GtkWidget *radio1, *radio2;
+       GtkWidget *hbox;
        GtkWidget *check1, *check2;
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Intersect" );
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
@@ -342,50 +331,50 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
 
 
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
        gtk_widget_show( vbox );
 
        // ---- vbox ----
 
 
-       radio1 = gtk_radio_button_new_with_label( NULL, "Use Whole Map" );
+       auto radio1 = gtk_radio_button_new_with_label( NULL, "Use Whole Map" );
        gtk_box_pack_start( GTK_BOX( vbox ), radio1, FALSE, FALSE, 2 );
        gtk_widget_show( radio1 );
 
-       radio2 = gtk_radio_button_new_with_label( ( (GtkRadioButton*)radio1 )->group, "Use Selected Brushes" );
+       auto radio2 = gtk_radio_button_new_with_label( gtk_radio_button_get_group(GTK_RADIO_BUTTON(radio1)), "Use Selected Brushes" );
        gtk_box_pack_start( GTK_BOX( vbox ), radio2, FALSE, FALSE, 2 );
        gtk_widget_show( radio2 );
 
-       w = gtk_hseparator_new();
-       gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 2 );
-       gtk_widget_show( w );
+       auto hsep = ui::Widget(gtk_hseparator_new());
+       gtk_box_pack_start( GTK_BOX( vbox ), hsep, FALSE, FALSE, 2 );
+       hsep.show();
 
-       check1 = gtk_check_button_new_with_label( "Include Detail Brushes" );
+       check1 = ui::CheckButton( "Include Detail Brushes" );
        gtk_box_pack_start( GTK_BOX( vbox ), check1, FALSE, FALSE, 0 );
        gtk_widget_show( check1 );
 
-       check2 = gtk_check_button_new_with_label( "Select Duplicate Brushes Only" );
+       check2 = ui::CheckButton( "Select Duplicate Brushes Only" );
        gtk_box_pack_start( GTK_BOX( vbox ), check2, FALSE, FALSE, 0 );
        gtk_widget_show( check2 );
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ---- ok/cancel buttons
 
-       w = gtk_button_new_with_label( "Ok" );
+       auto w = ui::Button( "Ok" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -417,7 +406,7 @@ EMessageBoxReturn DoIntersectBox( IntersectRS* rs ){
 }
 
 EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
-       GtkWidget *window, *w, *vbox, *hbox, *vbox2, *hbox2;
+       GtkWidget *hbox, *vbox2, *hbox2;
 
        GtkWidget *check1, *check2, *check3;
        GtkWidget *text1, *text2;
@@ -425,13 +414,13 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Polygon Builder" );
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
@@ -440,58 +429,58 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
 
 
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
+       vbox.show();
 
        // ---- vbox ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ----
 
 
-       vbox2 = gtk_vbox_new( FALSE, 10 );
+       vbox2 = ui::VBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( hbox ), vbox2, FALSE, FALSE, 2 );
        gtk_widget_show( vbox2 );
 
        // ---- vbox2 ----
 
-       hbox2 = gtk_hbox_new( FALSE, 10 );
+       hbox2 = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 2 );
        gtk_widget_show( hbox2 );
 
        // ---- hbox2 ----
 
-       text1 = gtk_entry_new_with_max_length( 256 );
+       text1 = ui::Entry( 256 );
        gtk_entry_set_text( (GtkEntry*)text1, "3" );
        gtk_box_pack_start( GTK_BOX( hbox2 ), text1, FALSE, FALSE, 2 );
        gtk_widget_show( text1 );
 
-       w = gtk_label_new( "Number Of Sides" );
-       gtk_box_pack_start( GTK_BOX( hbox2 ), w, FALSE, FALSE, 2 );
-       gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
-       gtk_widget_show( w );
+       auto l = ui::Label( "Number Of Sides" );
+       gtk_box_pack_start( GTK_BOX( hbox2 ), l, FALSE, FALSE, 2 );
+       gtk_label_set_justify( GTK_LABEL( l ), GTK_JUSTIFY_LEFT );
+       gtk_widget_show( l );
 
        // ---- /hbox2 ----
 
-       hbox2 = gtk_hbox_new( FALSE, 10 );
+       hbox2 = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 2 );
        gtk_widget_show( hbox2 );
 
        // ---- hbox2 ----
 
-       text2 = gtk_entry_new_with_max_length( 256 );
+       text2 = ui::Entry( 256 );
        gtk_entry_set_text( (GtkEntry*)text2, "8" );
        gtk_box_pack_start( GTK_BOX( hbox2 ), text2, FALSE, FALSE, 2 );
        gtk_widget_show( text2 );
 
-       w = gtk_label_new( "Border Width" );
-       gtk_box_pack_start( GTK_BOX( hbox2 ), w, FALSE, FALSE, 2 );
-       gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
-       gtk_widget_show( w );
+       l = ui::Label( "Border Width" );
+       gtk_box_pack_start( GTK_BOX( hbox2 ), l, FALSE, FALSE, 2 );
+       gtk_label_set_justify( GTK_LABEL( l ), GTK_JUSTIFY_LEFT );
+       gtk_widget_show( l );
 
        // ---- /hbox2 ----
 
@@ -499,23 +488,23 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
 
 
 
-       vbox2 = gtk_vbox_new( FALSE, 10 );
+       vbox2 = ui::VBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( hbox ), vbox2, FALSE, FALSE, 2 );
        gtk_widget_show( vbox2 );
 
        // ---- vbox2 ----
 
-       check1 = gtk_check_button_new_with_label( "Use Border" );
+       check1 = ui::CheckButton( "Use Border" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), check1, FALSE, FALSE, 0 );
        gtk_widget_show( check1 );
 
 
-       check2 = gtk_check_button_new_with_label( "Inverse Polygon" );
+       check2 = ui::CheckButton( "Inverse Polygon" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), check2, FALSE, FALSE, 0 );
        gtk_widget_show( check2 );
 
 
-       check3 = gtk_check_button_new_with_label( "Align Top Edge" );
+       check3 = ui::CheckButton( "Align Top Edge" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), check3, FALSE, FALSE, 0 );
        gtk_widget_show( check3 );
 
@@ -523,23 +512,23 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
 
        // ---- /hbox ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ----
 
-       w = gtk_button_new_with_label( "Ok" );
+       auto w = ui::Button( "Ok" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -587,8 +576,6 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){
 // for stair builder stuck as close as i could to the MFC version
 // obviously feel free to change it at will :)
 EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
-       // i made widgets for just about everything ... i think that's what i need to do  dunno tho
-       GtkWidget   *window, *w, *vbox, *hbox;
        GtkWidget   *textStairHeight, *textRiserTex, *textMainTex;
        GtkWidget   *radioNorth, *radioSouth, *radioEast, *radioWest;   // i'm guessing we can't just abuse 'w' for these if we're getting a value
        GtkWidget   *radioOldStyle, *radioBobStyle, *radioCornerStyle;
@@ -597,16 +584,16 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        EMessageBoxReturn ret;
        int loop = 1;
 
-       char    *text = "Please set a value in the boxes below and press 'OK' to build the stairs";
+       char *text = "Please set a value in the boxes below and press 'OK' to build the stairs";
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Stair Builder" );
 
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
@@ -614,51 +601,51 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        gtk_widget_realize( window );
 
        // new vbox
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
        gtk_widget_show( vbox );
 
-       hbox = gtk_hbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( vbox ), hbox );
+       auto hbox = ui::HBox( FALSE, 10 );
+       vbox.add(hbox);
        gtk_widget_show( hbox );
 
        // dunno if you want this text or not ...
-       w = gtk_label_new( text );
+       ui::Widget w = ui::Label( text );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 ); // not entirely sure on all the parameters / what they do ...
        gtk_widget_show( w );
 
-       w = gtk_hseparator_new();
+       w = ui::Widget(gtk_hseparator_new());
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
        // ------------------------- // indenting == good way of keeping track of lines :)
 
        // new hbox
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       textStairHeight = gtk_entry_new_with_max_length( 256 );
+       textStairHeight = ui::Entry( 256 );
        gtk_box_pack_start( GTK_BOX( hbox ), textStairHeight, FALSE, FALSE, 1 );
        gtk_widget_show( textStairHeight );
 
-       w = gtk_label_new( "Stair Height" );
+       w = ui::Label( "Stair Height" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 );
        gtk_widget_show( w );
 
        // ------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Direction:" );
+       w = ui::Label( "Direction:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 5 );
        gtk_widget_show( w );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
@@ -672,19 +659,19 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        gtk_box_pack_start( GTK_BOX( hbox ), radioNorth, FALSE, FALSE, 3 );
        gtk_widget_show( radioNorth );
 
-       radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNorth ) );
+       radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNorth ) );
 
        radioSouth = gtk_radio_button_new_with_label( radioDirection, "South" );
        gtk_box_pack_start( GTK_BOX( hbox ), radioSouth, FALSE, FALSE, 2 );
        gtk_widget_show( radioSouth );
 
-       radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioSouth ) );
+       radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioSouth ) );
 
        radioEast = gtk_radio_button_new_with_label( radioDirection, "East" );
        gtk_box_pack_start( GTK_BOX( hbox ), radioEast, FALSE, FALSE, 1 );
        gtk_widget_show( radioEast );
 
-       radioDirection = gtk_radio_button_group( GTK_RADIO_BUTTON( radioEast ) );
+       radioDirection = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioEast ) );
 
        radioWest = gtk_radio_button_new_with_label( radioDirection, "West" );
        gtk_box_pack_start( GTK_BOX( hbox ), radioWest, FALSE, FALSE, 0 );
@@ -692,17 +679,17 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
 
        // --------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Style:" );
+       w = ui::Label( "Style:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 5 );
        gtk_widget_show( w );
 
        // --------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
@@ -710,13 +697,13 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        gtk_box_pack_start( GTK_BOX( hbox ), radioOldStyle, FALSE, FALSE, 0 );
        gtk_widget_show( radioOldStyle );
 
-       radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioOldStyle ) );
+       radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioOldStyle ) );
 
        radioBobStyle = gtk_radio_button_new_with_label( radioStyle, "Bob's Style" );
        gtk_box_pack_start( GTK_BOX( hbox ), radioBobStyle, FALSE, FALSE, 0 );
        gtk_widget_show( radioBobStyle );
 
-       radioStyle = gtk_radio_button_group( GTK_RADIO_BUTTON( radioBobStyle ) );
+       radioStyle = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioBobStyle ) );
 
        radioCornerStyle = gtk_radio_button_new_with_label( radioStyle, "Corner Style" );
        gtk_box_pack_start( GTK_BOX( hbox ), radioCornerStyle, FALSE, FALSE, 0 );
@@ -729,58 +716,58 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
        // djbob: think we need some button callback functions or smuffin
        // FIXME: actually get around to doing what i suggested!!!!
 
-       checkUseDetail = gtk_check_button_new_with_label( "Use Detail Brushes" );
+       checkUseDetail = ui::CheckButton( "Use Detail Brushes" );
        gtk_box_pack_start( GTK_BOX( hbox ), checkUseDetail, FALSE, FALSE, 0 );
        gtk_widget_show( checkUseDetail );
 
        // --------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       textMainTex = gtk_entry_new_with_max_length( 512 );
+       textMainTex = ui::Entry( 512 );
        gtk_entry_set_text( GTK_ENTRY( textMainTex ), rs->mainTexture );
        gtk_box_pack_start( GTK_BOX( hbox ), textMainTex, FALSE, FALSE, 0 );
        gtk_widget_show( textMainTex );
 
-       w = gtk_label_new( "Main Texture" );
+       w = ui::Label( "Main Texture" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 );
        gtk_widget_show( w );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       textRiserTex = gtk_entry_new_with_max_length( 512 );
+       textRiserTex = ui::Entry( 512 );
        gtk_box_pack_start( GTK_BOX( hbox ), textRiserTex, FALSE, FALSE, 0 );
        gtk_widget_show( textRiserTex );
 
-       w = gtk_label_new( "Riser Texture" );
+       w = ui::Label( "Riser Texture" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 );
        gtk_widget_show( w );
 
        // -------------------------- //
-       w = gtk_hseparator_new();
+       w = ui::Widget(gtk_hseparator_new());
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "OK" );
+       w = ui::Button( "OK" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
 
        ret = eIDCANCEL;
@@ -844,25 +831,22 @@ EMessageBoxReturn DoBuildStairsBox( BuildStairsRS* rs ){
 }
 
 EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
-       GtkWidget   *window, *hbox, *vbox, *w;
-       GtkWidget   *textFrontBackTex, *textTrimTex;
+       GtkWidget   *hbox;
        GtkWidget   *checkScaleMainH, *checkScaleMainV, *checkScaleTrimH, *checkScaleTrimV;
-       GtkWidget   *comboMain, *comboTrim;
-       GtkWidget   *buttonSetMain, *buttonSetTrim;
        GtkWidget   *radioNS, *radioEW;
        GSList      *radioOrientation;
        TwinWidget tw1, tw2;
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Door Builder" );
 
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
@@ -870,126 +854,124 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
        gtk_widget_realize( window );
 
        char buffer[256];
-       GList       *listMainTextures = NULL;
-       GList       *listTrimTextures = NULL;
-       LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), &listMainTextures );
-       LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), &listTrimTextures );
+       ui::ListStore listMainTextures = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
+       ui::ListStore listTrimTextures = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
+       LoadGList( GetFilename( buffer, "plugins/bt/door-tex.txt" ), listMainTextures );
+       LoadGList( GetFilename( buffer, "plugins/bt/door-tex-trim.txt" ), listTrimTextures );
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
        gtk_widget_show( vbox );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       textFrontBackTex = gtk_entry_new_with_max_length( 512 );
+       auto textFrontBackTex = ui::Entry( 512 );
        gtk_entry_set_text( GTK_ENTRY( textFrontBackTex ), rs->mainTexture );
        gtk_box_pack_start( GTK_BOX( hbox ), textFrontBackTex, FALSE, FALSE, 0 );
        gtk_widget_show( textFrontBackTex );
 
-       w = gtk_label_new( "Door Front/Back Texture" );
+       ui::Widget w = ui::Label( "Door Front/Back Texture" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
        // ------------------------ //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       textTrimTex = gtk_entry_new_with_max_length( 512 );
+       auto textTrimTex = ui::Entry( 512 );
        gtk_box_pack_start( GTK_BOX( hbox ), textTrimTex, FALSE, FALSE, 0 );
        gtk_widget_show( textTrimTex );
 
-       w = gtk_label_new( "Door Trim Texture" );
+       w = ui::Label( "Door Trim Texture" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
        // ----------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
        // sp: horizontally ????
        // djbob: yes mars, u can spell :]
-       checkScaleMainH = gtk_check_button_new_with_label( "Scale Main Texture Horizontally" );
+       checkScaleMainH = ui::CheckButton( "Scale Main Texture Horizontally" );
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( checkScaleMainH ), TRUE );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleMainH, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleMainH );
 
-       checkScaleTrimH = gtk_check_button_new_with_label( "Scale Trim Texture Horizontally" );
+       checkScaleTrimH = ui::CheckButton( "Scale Trim Texture Horizontally" );
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( checkScaleTrimH ), TRUE );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleTrimH, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleTrimH );
 
        // ---------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       checkScaleMainV = gtk_check_button_new_with_label( "Scale Main Texture Vertically" );
+       checkScaleMainV = ui::CheckButton( "Scale Main Texture Vertically" );
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( checkScaleMainV ), TRUE );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleMainV, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleMainV );
 
-       checkScaleTrimV = gtk_check_button_new_with_label( "Scale Trim Texture Vertically" );
+       checkScaleTrimV = ui::CheckButton( "Scale Trim Texture Vertically" );
        gtk_box_pack_start( GTK_BOX( hbox ), checkScaleTrimV, FALSE, FALSE, 0 );
        gtk_widget_show( checkScaleTrimV );
 
        // --------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
        // djbob: lists added
 
-       comboMain = gtk_combo_new();
+       auto comboMain = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listMainTextures))));
+       gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0);
        gtk_box_pack_start( GTK_BOX( hbox ), comboMain, FALSE, FALSE, 0 );
-       gtk_combo_set_popdown_strings( GTK_COMBO( comboMain ), listMainTextures );
-       gtk_combo_set_use_arrows( GTK_COMBO( comboMain ), 1 );
        gtk_widget_show( comboMain );
 
        tw1.one = textFrontBackTex;
        tw1.two = comboMain;
 
-       buttonSetMain = gtk_button_new_with_label( "Set As Main Texture" );
-       gtk_signal_connect( GTK_OBJECT( buttonSetMain ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw1 );
+       auto buttonSetMain = ui::Button( "Set As Main Texture" );
+       buttonSetMain.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw1 );
        gtk_box_pack_start( GTK_BOX( hbox ), buttonSetMain, FALSE, FALSE, 0 );
        gtk_widget_show( buttonSetMain );
 
        // ------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       comboTrim = gtk_combo_new();
+       auto comboTrim = ui::ComboBox(GTK_COMBO_BOX(gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(listTrimTextures))));
+       gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(comboMain), 0);
        gtk_box_pack_start( GTK_BOX( hbox ), comboTrim, FALSE, FALSE, 0 );
-       gtk_combo_set_popdown_strings( GTK_COMBO( comboTrim ), listTrimTextures );
-       gtk_combo_set_use_arrows( GTK_COMBO( comboMain ), 1 );
        gtk_widget_show( comboTrim );
 
        tw2.one = textTrimTex;
        tw2.two = comboTrim;
 
-       buttonSetTrim = gtk_button_new_with_label( "Set As Trim Texture" );
-       gtk_signal_connect( GTK_OBJECT( buttonSetTrim ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback_settex ), &tw2 );
+       auto buttonSetTrim = ui::Button( "Set As Trim Texture" );
+       buttonSetTrim.connect( "clicked", G_CALLBACK( dialog_button_callback_settex ), &tw2 );
        gtk_box_pack_start( GTK_BOX( hbox ), buttonSetTrim, FALSE, FALSE, 0 );
        gtk_widget_show( buttonSetTrim );
 
        // ------------------ //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Orientation" );
+       w = ui::Label( "Orientation" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
@@ -998,7 +980,7 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
        gtk_box_pack_start( GTK_BOX( hbox ), radioNS, FALSE, FALSE, 0 );
        gtk_widget_show( radioNS );
 
-       radioOrientation = gtk_radio_button_group( GTK_RADIO_BUTTON( radioNS ) );
+       radioOrientation = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radioNS ) );
 
        radioEW = gtk_radio_button_new_with_label( radioOrientation, "East - West" );
        gtk_box_pack_start( GTK_BOX( hbox ), radioEW, FALSE, FALSE, 0 );
@@ -1006,26 +988,26 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
 
        // ----------------- //
 
-       w = gtk_hseparator_new();
+       w = ui::Widget(gtk_hseparator_new());
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
        // ----------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "OK" );
+       w = ui::Button( "OK" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -1062,21 +1044,21 @@ EMessageBoxReturn DoDoorsBox( DoorRS* rs ){
 }
 
 EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
-       GtkWidget *window, *w, *vbox, *hbox;
+       ui::Widget w, hbox;
 
-       GtkWidget *text1, *text2, *text3;
-       GtkWidget *check1, *check2;
+       ui::Entry text1, text2, text3;
+       ui::Widget check1, check2;
 
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
@@ -1085,80 +1067,80 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
 
 
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
        gtk_widget_show( vbox );
 
        // ---- vbox ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ----
 
-       text1 = gtk_entry_new_with_max_length( 256 );
-       gtk_entry_set_text( (GtkEntry*)text1, "25" );
+       text1 = ui::Entry( 256 );
+       gtk_entry_set_text( text1, "25" );
        gtk_box_pack_start( GTK_BOX( hbox ), text1, FALSE, FALSE, 2 );
        gtk_widget_show( text1 );
 
-       w = gtk_label_new( "Number Of Points" );
+       w = ui::Label( "Number Of Points" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 );
        gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
        gtk_widget_show( w );
 
        // ---- /hbox ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ----
 
-       text2 = gtk_entry_new_with_max_length( 256 );
-       gtk_entry_set_text( (GtkEntry*)text2, "3" );
+       text2 = ui::Entry( 256 );
+       gtk_entry_set_text( text2, "3" );
        gtk_box_pack_start( GTK_BOX( hbox ), text2, FALSE, FALSE, 2 );
        gtk_widget_show( text2 );
 
-       w = gtk_label_new( "Multipler" );
+       w = ui::Label( "Multipler" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 );
        gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
        gtk_widget_show( w );
 
        // ---- /hbox ----
 
-       w = gtk_label_new( "Path Distance = dist(start -> apex) * multiplier" );
+       w = ui::Label( "Path Distance = dist(start -> apex) * multiplier" );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
        gtk_widget_show( w );
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ----
 
-       text3 = gtk_entry_new_with_max_length( 256 );
-       gtk_entry_set_text( (GtkEntry*)text3, "-800" );
+       text3 = ui::Entry( 256 );
+       gtk_entry_set_text( text3, "-800" );
        gtk_box_pack_start( GTK_BOX( hbox ), text3, FALSE, FALSE, 2 );
        gtk_widget_show( text3 );
 
-       w = gtk_label_new( "Gravity" );
+       w = ui::Label( "Gravity" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 );
        gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
        gtk_widget_show( w );
 
        // ---- /hbox ----
 
-       w = gtk_hseparator_new();
+       w = ui::Widget(gtk_hseparator_new());
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       check1 = gtk_check_button_new_with_label( "No Dynamic Update" );
+       check1 = ui::CheckButton( "No Dynamic Update" );
        gtk_box_pack_start( GTK_BOX( vbox ), check1, FALSE, FALSE, 0 );
        gtk_widget_show( check1 );
 
-       check2 = gtk_check_button_new_with_label( "Show Bounding Lines" );
+       check2 = ui::CheckButton( "Show Bounding Lines" );
        gtk_box_pack_start( GTK_BOX( vbox ), check2, FALSE, FALSE, 0 );
        gtk_widget_show( check2 );
 
@@ -1167,32 +1149,32 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
 
        // ----------------- //
 
-       w = gtk_hseparator_new();
+       w = ui::Widget(gtk_hseparator_new());
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
        // ----------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "Enable" );
+       w = ui::Button( "Enable" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
-       w = gtk_button_new_with_label( "Disable" );
+       w = ui::Button( "Disable" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDNO ) );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
 
        ret = eIDCANCEL;
@@ -1237,17 +1219,17 @@ EMessageBoxReturn DoPathPlotterBox( PathPlotterRS* rs ){
 }
 
 EMessageBoxReturn DoCTFColourChangeBox(){
-       GtkWidget *window, *w, *vbox, *hbox;
+       ui::Widget w, hbox;
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "CTF Colour Changer" );
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
@@ -1256,34 +1238,34 @@ EMessageBoxReturn DoCTFColourChangeBox(){
 
 
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
        gtk_widget_show( vbox );
 
        // ---- vbox ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, TRUE, 0 );
        gtk_widget_show( hbox );
 
        // ---- hbox ---- ok/cancel buttons
 
-       w = gtk_button_new_with_label( "Red->Blue" );
+       w = ui::Button( "Red->Blue" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Blue->Red" );
+       w = ui::Button( "Blue->Red" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -1307,31 +1289,31 @@ EMessageBoxReturn DoCTFColourChangeBox(){
 EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
        Str texSelected;
 
-       GtkWidget *window, *w, *vbox, *hbox, *frame, *table;
+       ui::Widget w, hbox;
 
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Texture Reset" );
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
 
        gtk_widget_realize( window );
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
+       vbox.show();
 
        // ---- vbox ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
@@ -1340,53 +1322,53 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
        texSelected = "Currently Selected Texture:   ";
        texSelected += GetCurrentTexture();
 
-       w = gtk_label_new( texSelected );
+       w = ui::Label( texSelected );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 2 );
        gtk_label_set_justify( GTK_LABEL( w ), GTK_JUSTIFY_LEFT );
        gtk_widget_show( w );
 
        // ---- /hbox ----
 
-       frame = gtk_frame_new( "Reset Texture Names" );
+       auto frame = ui::Frame( "Reset Texture Names" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       auto table = ui::Table( 2, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       dlgTexReset.cbTexChange = gtk_check_button_new_with_label( "Enabled" );
-       gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbTexChange ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+       dlgTexReset.cbTexChange = ui::CheckButton( "Enabled" );
+       dlgTexReset.cbTexChange.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbTexChange );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbTexChange, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
-       w = gtk_label_new( "Old Name: " );
+       w = ui::Label( "Old Name: " );
        gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       dlgTexReset.editTexOld = gtk_entry_new_with_max_length( 256 );
+       dlgTexReset.editTexOld = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexOld ), rs->textureName );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexOld, 2, 3, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( dlgTexReset.editTexOld );
 
-       w = gtk_label_new( "New Name: " );
+       w = ui::Label( "New Name: " );
        gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       dlgTexReset.editTexNew = gtk_entry_new_with_max_length( 256 );
+       dlgTexReset.editTexNew = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editTexNew ), rs->textureName );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editTexNew, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1395,33 +1377,33 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- /frame ----
 
-       frame = gtk_frame_new( "Reset Scales" );
+       frame = ui::Frame( "Reset Scales" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       table = ui::Table( 2, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       dlgTexReset.cbScaleHor = gtk_check_button_new_with_label( "Enabled" );
-       gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+       dlgTexReset.cbScaleHor = ui::CheckButton( "Enabled" );
+       dlgTexReset.cbScaleHor.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbScaleHor );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleHor, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
-       w = gtk_label_new( "New Horizontal Scale: " );
+       w = ui::Label( "New Horizontal Scale: " );
        gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       dlgTexReset.editScaleHor = gtk_entry_new_with_max_length( 256 );
+       dlgTexReset.editScaleHor = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleHor ), "0.5" );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleHor, 2, 3, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1429,20 +1411,20 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
        gtk_widget_show( dlgTexReset.editScaleHor );
 
 
-       dlgTexReset.cbScaleVert = gtk_check_button_new_with_label( "Enabled" );
-       gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbScaleVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+       dlgTexReset.cbScaleVert = ui::CheckButton( "Enabled" );
+       dlgTexReset.cbScaleVert.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbScaleVert );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbScaleVert, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
-       w = gtk_label_new( "New Vertical Scale: " );
+       w = ui::Label( "New Vertical Scale: " );
        gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       dlgTexReset.editScaleVert = gtk_entry_new_with_max_length( 256 );
+       dlgTexReset.editScaleVert = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editScaleVert ), "0.5" );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editScaleVert, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1451,33 +1433,33 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- /frame ----
 
-       frame = gtk_frame_new( "Reset Shift" );
+       frame = ui::Frame( "Reset Shift" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       table = ui::Table( 2, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       dlgTexReset.cbShiftHor = gtk_check_button_new_with_label( "Enabled" );
-       gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftHor ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+       dlgTexReset.cbShiftHor = ui::CheckButton( "Enabled" );
+       dlgTexReset.cbShiftHor.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbShiftHor );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftHor, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
-       w = gtk_label_new( "New Horizontal Shift: " );
+       w = ui::Label( "New Horizontal Shift: " );
        gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       dlgTexReset.editShiftHor = gtk_entry_new_with_max_length( 256 );
+       dlgTexReset.editShiftHor = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftHor ), "0" );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftHor, 2, 3, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1485,20 +1467,20 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
        gtk_widget_show( dlgTexReset.editShiftHor );
 
 
-       dlgTexReset.cbShiftVert = gtk_check_button_new_with_label( "Enabled" );
-       gtk_signal_connect( GTK_OBJECT( dlgTexReset.cbShiftVert ), "toggled", GTK_SIGNAL_FUNC( dialog_button_callback_texreset_update ), NULL );
+       dlgTexReset.cbShiftVert = ui::CheckButton( "Enabled" );
+       dlgTexReset.cbShiftVert.connect( "toggled", G_CALLBACK( dialog_button_callback_texreset_update ), NULL );
        gtk_widget_show( dlgTexReset.cbShiftVert );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbShiftVert, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
-       w = gtk_label_new( "New Vertical Shift: " );
+       w = ui::Label( "New Vertical Shift: " );
        gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       dlgTexReset.editShiftVert = gtk_entry_new_with_max_length( 256 );
+       dlgTexReset.editShiftVert = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editShiftVert ), "0" );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editShiftVert, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1507,32 +1489,32 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- /frame ----
 
-       frame = gtk_frame_new( "Reset Rotation" );
+       frame = ui::Frame( "Reset Rotation" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 1, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       table = ui::Table( 1, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       dlgTexReset.cbRotation = gtk_check_button_new_with_label( "Enabled" );
+       dlgTexReset.cbRotation = ui::CheckButton( "Enabled" );
        gtk_widget_show( dlgTexReset.cbRotation );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.cbRotation, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
 
-       w = gtk_label_new( "New Rotation Value: " );
+       w = ui::Label( "New Rotation Value: " );
        gtk_table_attach( GTK_TABLE( table ), w, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       dlgTexReset.editRotation = gtk_entry_new_with_max_length( 256 );
+       dlgTexReset.editRotation = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( dlgTexReset.editRotation ), "0" );
        gtk_table_attach( GTK_TABLE( table ), dlgTexReset.editRotation, 2, 3, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1541,28 +1523,28 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 
        // ---- /frame ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ----
 
-       w = gtk_button_new_with_label( "Use Selected Brushes" );
+       w = ui::Button( "Use Selected Brushes" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Use All Brushes" );
+       w = ui::Button( "Use All Brushes" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDYES ) );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -1638,61 +1620,61 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs ){
 EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
        Str texSelected;
 
-       GtkWidget *window, *w, *vbox, *hbox, *frame, *table;
+       ui::Widget w, hbox;
 
-       GtkWidget *radiusX, *radiusY;
-       GtkWidget *angleStart, *angleEnd;
-       GtkWidget *heightStart, *heightEnd;
-       GtkWidget *numPoints;
+       ui::Widget radiusX, radiusY;
+       ui::Widget angleStart, angleEnd;
+       ui::Widget heightStart, heightEnd;
+       ui::Widget numPoints;
 
        EMessageBoxReturn ret;
        int loop = 1;
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Train Thing" );
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
-       gtk_object_set_data( GTK_OBJECT( window ), "loop", &loop );
-       gtk_object_set_data( GTK_OBJECT( window ), "ret", &ret );
+       g_object_set_data( G_OBJECT( window ), "loop", &loop );
+       g_object_set_data( G_OBJECT( window ), "ret", &ret );
 
        gtk_widget_realize( window );
 
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
+       vbox.show();
 
        // ---- vbox ----
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- /hbox ----
 
-       frame = gtk_frame_new( "Radii" );
+       auto frame = ui::Frame( "Radii" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       auto table = ui::Table( 2, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       w = gtk_label_new( "X: " );
+       w = ui::Label( "X: " );
        gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       radiusX = gtk_entry_new_with_max_length( 256 );
+       radiusX = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( radiusX ), "100" );
        gtk_table_attach( GTK_TABLE( table ), radiusX, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1701,13 +1683,13 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
 
 
 
-       w = gtk_label_new( "Y: " );
+       w = ui::Label( "Y: " );
        gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       radiusY = gtk_entry_new_with_max_length( 256 );
+       radiusY = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( radiusY ), "100" );
        gtk_table_attach( GTK_TABLE( table ), radiusY, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1716,26 +1698,26 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
 
 
 
-       frame = gtk_frame_new( "Angles" );
+       frame = ui::Frame( "Angles" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       table = ui::Table( 2, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       w = gtk_label_new( "Start: " );
+       w = ui::Label( "Start: " );
        gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       angleStart = gtk_entry_new_with_max_length( 256 );
+       angleStart = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( angleStart ), "0" );
        gtk_table_attach( GTK_TABLE( table ), angleStart, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1744,13 +1726,13 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
 
 
 
-       w = gtk_label_new( "End: " );
+       w = ui::Label( "End: " );
        gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       angleEnd = gtk_entry_new_with_max_length( 256 );
+       angleEnd = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( angleEnd ), "90" );
        gtk_table_attach( GTK_TABLE( table ), angleEnd, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1758,26 +1740,26 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
        gtk_widget_show( angleEnd );
 
 
-       frame = gtk_frame_new( "Height" );
+       frame = ui::Frame( "Height" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       table = ui::Table( 2, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       w = gtk_label_new( "Start: " );
+       w = ui::Label( "Start: " );
        gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       heightStart = gtk_entry_new_with_max_length( 256 );
+       heightStart = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( heightStart ), "0" );
        gtk_table_attach( GTK_TABLE( table ), heightStart, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1786,13 +1768,13 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
 
 
 
-       w = gtk_label_new( "End: " );
+       w = ui::Label( "End: " );
        gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       heightEnd = gtk_entry_new_with_max_length( 256 );
+       heightEnd = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( heightEnd ), "0" );
        gtk_table_attach( GTK_TABLE( table ), heightEnd, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1801,26 +1783,26 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
 
 
 
-       frame = gtk_frame_new( "Points" );
+       frame = ui::Frame( "Points" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 3, TRUE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       table = ui::Table( 2, 3, TRUE );
+       table.show();
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
 
        // ---- frame ----
 
-       w = gtk_label_new( "Number: " );
+       w = ui::Label( "Number: " );
        gtk_table_attach( GTK_TABLE( table ), w, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_widget_show( w );
 
-       numPoints = gtk_entry_new_with_max_length( 256 );
+       numPoints = ui::Entry( 256 );
        gtk_entry_set_text( GTK_ENTRY( numPoints ), "0" );
        gtk_table_attach( GTK_TABLE( table ), numPoints, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1828,23 +1810,23 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
        gtk_widget_show( numPoints );
 
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 2 );
        gtk_widget_show( hbox );
 
        // ---- hbox ----
 
-       w = gtk_button_new_with_label( "Ok" );
+       w = ui::Button( "Ok" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -1904,21 +1886,21 @@ EMessageBoxReturn DoTrainThingBox( TrainThingRS* rs ){
 // ailmanki
 // add a simple input for the MakeChain thing..
 EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
-       GtkWidget   *window, *w, *vbox, *hbox;
-       GtkWidget   *textlinkNum, *textlinkName;
+       ui::Widget   w;
+       ui::Entry textlinkNum, textlinkName;
        EMessageBoxReturn ret;
        int loop = 1;
 
-       char    *text = "Please set a value in the boxes below and press 'OK' to make a chain";
+       char const *text = "Please set a value in the boxes below and press 'OK' to make a chain";
 
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
 
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
 
        gtk_window_set_title( GTK_WINDOW( window ), "Make Chain" );
 
-       gtk_container_border_width( GTK_CONTAINER( window ), 10 );
+       gtk_container_set_border_width( GTK_CONTAINER( window ), 10 );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
        g_object_set_data( G_OBJECT( window ), "ret", &ret );
@@ -1926,63 +1908,63 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
        gtk_widget_realize( window );
 
        // new vbox
-       vbox = gtk_vbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 10 );
+       window.add(vbox);
+       vbox.show();
 
-       hbox = gtk_hbox_new( FALSE, 10 );
-       gtk_container_add( GTK_CONTAINER( vbox ), hbox );
-       gtk_widget_show( hbox );
+       auto hbox = ui::HBox( FALSE, 10 );
+       vbox.add(hbox);
+       hbox.show();
 
        // dunno if you want this text or not ...
-       w = gtk_label_new( text );
+       w = ui::Label( text );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       w = gtk_hseparator_new();
+       w = ui::Widget(gtk_hseparator_new());
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
        // ------------------------- //
 
        // new hbox
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       textlinkNum = gtk_entry_new_with_max_length( 256 );
+       textlinkNum = ui::Entry( 256 );
        gtk_box_pack_start( GTK_BOX( hbox ), textlinkNum, FALSE, FALSE, 1 );
        gtk_widget_show( textlinkNum );
 
-       w = gtk_label_new( "Number of elements in chain" );
+       w = ui::Label( "Number of elements in chain" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 );
        gtk_widget_show( w );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 10 );
+       hbox = ui::HBox( FALSE, 10 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       textlinkName = gtk_entry_new_with_max_length( 256 );
+       textlinkName = ui::Entry( 256 );
        gtk_box_pack_start( GTK_BOX( hbox ), textlinkName, FALSE, FALSE, 0 );
        gtk_widget_show( textlinkName );
 
-       w = gtk_label_new( "Basename for chain's targetnames." );
+       w = ui::Label( "Basename for chain's targetnames." );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 1 );
        gtk_widget_show( w );
 
 
-       w = gtk_button_new_with_label( "OK" );
+       w = ui::Button( "OK" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
 
        ret = eIDCANCEL;
@@ -2001,8 +1983,8 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
                dialogError = FALSE;
 
                if ( ret == eIDOK ) {
-                       strcpy( rs->linkName, gtk_entry_get_text( (GtkEntry*)textlinkName ) );
-                       if ( !ValidateTextInt( gtk_entry_get_text( (GtkEntry*)textlinkNum ), "Elements", &rs->linkNum ) ) {
+                       strcpy( rs->linkName, gtk_entry_get_text( textlinkName ) );
+                       if ( !ValidateTextInt( gtk_entry_get_text( textlinkNum ), "Elements", &rs->linkNum ) ) {
                                dialogError = TRUE;
                        }
                }
@@ -2012,4 +1994,4 @@ EMessageBoxReturn DoMakeChainBox( MakeChainRS* rs ){
        gtk_widget_destroy( window );
 
        return ret;
-}
\ No newline at end of file
+}
index ae35490431b48cfcd43779ecb82c292c77e21322..a8490459fac9e7922c7386a48a2a3186bac84c0e 100644 (file)
@@ -90,11 +90,9 @@ struct MakeChainRS {
        int linkNum;
 };
 
-typedef struct _GtkWidget GtkWidget;
-
 struct TwinWidget {
-       GtkWidget* one;
-       GtkWidget* two;
+       ui::Widget one{ui::null};
+       ui::ComboBox two{ui::null};
 };
 
 EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMessageBoxType type );
index 810798397d6b7cfac63542f60d41c17a8fb612a3..96aff1976aabe0c309917ac322b2678ae8976e8c 100644 (file)
@@ -24,6 +24,7 @@
 #endif
 
 #include <glib.h>
+#include <gtk/gtk.h>
 
 #include "misc.h"
 
@@ -54,7 +55,7 @@ bool LoadExclusionList( char* filename, std::list<Str>* exclusionList ){
        return FALSE;
 }
 
-bool LoadGList( char* filename, GList** loadlist ){
+bool LoadGList( char* filename, ui::ListStore loadlist ){
        FILE* eFile = fopen( filename, "r" );
        if ( eFile ) {
                char buffer[256];
@@ -67,7 +68,9 @@ bool LoadGList( char* filename, GList** loadlist ){
                        if ( strlen( buffer ) > 0 ) {
                                char* buffer2 = new char[strlen( buffer ) + 1];
                                strcpy( buffer2, buffer );
-                               *loadlist = g_list_append( *loadlist, buffer2 );
+                               GtkTreeIter iter;
+                               gtk_list_store_append(loadlist, &iter);
+                               gtk_list_store_set(loadlist, &iter, 0, buffer2, -1);
                        }
                        else{
                                cnt++;
index 827c9cbc1638b2a97221b7a8d5a181be4ea96717..7a8ecc1802dabb503b8c33ccc6f86d7a67ed56cf 100644 (file)
@@ -18,8 +18,9 @@
  */
 
 #include <list>
+#include <uilib/uilib.h>
 #include "str.h"
 typedef struct _GList GList;
 
 bool LoadExclusionList( char* filename, std::list<Str>* exclusionList );
-bool LoadGList( char* filename, GList** loadlist );
+bool LoadGList( char* filename, ui::ListStore loadlist );
index f466c5153558315b3a223d3419558b87982ee6f7..2e47035d75b5e0630c611bc8395369198edc32b4 100644 (file)
@@ -58,9 +58,9 @@
        / |   / |
       /  |  /  |
     4 ----- 6  |
- |  2|_|___|8
- |  /  |   /
- | /   |  /       ----> WEST, definitely
    |  2|_|___|8
    |  /  |   /
    | /   |  /       ----> WEST, definitely
  ||/    | /
     1|_____|/3
 
index 6a346f3a07a6ce7997c25f3f9e9a087651fe0f97..29fb3263aeb1abe6542961424ddff6f7f87460f2 100644 (file)
@@ -18,8 +18,8 @@ void OnDestroy( GtkWidget* w, gpointer data ){
 }
 
 void OnExportClicked( GtkButton* button, gpointer user_data ){
-       GtkWidget* window = lookup_widget( GTK_WIDGET( button ), "w_plugplug2" );
-       ASSERT_NOTNULL( window );
+       ui::Widget window = lookup_widget( GTK_WIDGET( button ), "w_plugplug2" );
+       ASSERT_TRUE( window );
        const char* cpath = GlobalRadiant().m_pfnFileDialog( window, false, "Save as Obj", 0, 0, false, false, true );
        if ( !cpath ) {
                return;
@@ -31,7 +31,7 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
        std::set<std::string> ignore;
 
        GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
-       GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
+       ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
 
        GtkTreeIter iter;
        gboolean valid = gtk_tree_model_get_iter_first( GTK_TREE_MODEL( list ), &iter );
@@ -68,7 +68,7 @@ void OnExportClicked( GtkButton* button, gpointer user_data ){
                {
                        radio = lookup_widget( GTK_WIDGET( button ), "r_nocollapse" );
                        ASSERT_NOTNULL( radio );
-                       ASSERT_NOTNULL( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) );
+                       ASSERT_TRUE( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio ) ) );
                        mode = COLLAPSE_NONE;
                }
        }
@@ -113,7 +113,7 @@ void OnAddMaterial( GtkButton* button, gpointer user_data ){
 
        const gchar* name = gtk_entry_get_text( edit );
        if ( g_utf8_strlen( name, -1 ) > 0 ) {
-               GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) ) ) );
+               ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) ) ) ));
                GtkTreeIter iter;
                gtk_list_store_append( list, &iter );
                gtk_list_store_set( list, &iter, 0, name, -1 );
@@ -123,7 +123,7 @@ void OnAddMaterial( GtkButton* button, gpointer user_data ){
 
 void OnRemoveMaterial( GtkButton* button, gpointer user_data ){
        GtkTreeView* view = GTK_TREE_VIEW( lookup_widget( GTK_WIDGET( button ), "t_materialist" ) );
-       GtkListStore* list = GTK_LIST_STORE( gtk_tree_view_get_model( view ) );
+       ui::ListStore list = ui::ListStore(GTK_LIST_STORE( gtk_tree_view_get_model( view ) ));
        GtkTreeSelection* sel = gtk_tree_view_get_selection( view );
 
        GtkTreeIter iter;
index eea5aa8b334ff720267e3b54f0403d531a27ffd7..eece65a185605e956c493eab95a489464c60850e 100644 (file)
@@ -1,5 +1,3 @@
-typedef struct _GtkWidget GtkWidget;
-typedef struct _GtkButton GtkButton;
 
 namespace callbacks {
 
index 76279ab043eb6dff5be61d5873cd8783b681a796..c08ce71add8d0ca17b4be1346fe0106dfae5df3c 100644 (file)
@@ -7,16 +7,14 @@
 
 #define GLADE_HOOKUP_OBJECT( component,widget,name ) \
        g_object_set_data_full( G_OBJECT( component ), name, \
-                                                       gtk_widget_ref( widget ), (GDestroyNotify) gtk_widget_unref )
+                                                       g_object_ref( (void *) widget ), (GDestroyNotify) g_object_unref )
 
 #define GLADE_HOOKUP_OBJECT_NO_REF( component,widget,name )    \
-       g_object_set_data( G_OBJECT( component ), name, widget )
+       g_object_set_data( G_OBJECT( component ), name, (void *) widget )
 
 // created by glade
 GtkWidget*
 create_w_plugplug2( void ){
-       GtkWidget *w_plugplug2;
-       GtkWidget *vbox1;
        GtkWidget *hbox2;
        GtkWidget *vbox4;
        GtkWidget *r_collapse;
@@ -24,49 +22,39 @@ create_w_plugplug2( void ){
        GtkWidget *r_collapsebymaterial;
        GtkWidget *r_nocollapse;
        GtkWidget *vbox3;
-       GtkWidget *b_export;
-       GtkWidget *b_close;
        GtkWidget *vbox2;
        GtkWidget *label1;
-       GtkWidget *scrolledwindow1;
-       GtkWidget *t_materialist;
        GtkWidget *ed_materialname;
        GtkWidget *hbox1;
-       GtkWidget *b_addmaterial;
-       GtkWidget *b_removematerial;
-       GtkWidget *t_exportmaterials;
        GtkWidget *t_limitmatnames;
        GtkWidget *t_objects;
-       GtkTooltips *tooltips;
 
-       tooltips = gtk_tooltips_new();
-
-       w_plugplug2 = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto w_plugplug2 = ui::Window( ui::window_type::TOP );
        gtk_widget_set_name( w_plugplug2, "w_plugplug2" );
        gtk_window_set_title( GTK_WINDOW( w_plugplug2 ), "BrushExport-Plugin 3.0 by namespace" );
        gtk_window_set_position( GTK_WINDOW( w_plugplug2 ), GTK_WIN_POS_CENTER );
        gtk_window_set_destroy_with_parent( GTK_WINDOW( w_plugplug2 ), TRUE );
 
-       vbox1 = gtk_vbox_new( FALSE, 0 );
+       auto vbox1 = ui::VBox( FALSE, 0 );
        gtk_widget_set_name( vbox1, "vbox1" );
        gtk_widget_show( vbox1 );
-       gtk_container_add( GTK_CONTAINER( w_plugplug2 ), vbox1 );
+       w_plugplug2.add(vbox1);
        gtk_container_set_border_width( GTK_CONTAINER( vbox1 ), 5 );
 
-       hbox2 = gtk_hbox_new( TRUE, 5 );
+       hbox2 = ui::HBox( TRUE, 5 );
        gtk_widget_set_name( hbox2, "hbox2" );
        gtk_widget_show( hbox2 );
        gtk_box_pack_start( GTK_BOX( vbox1 ), hbox2, FALSE, FALSE, 0 );
        gtk_container_set_border_width( GTK_CONTAINER( hbox2 ), 5 );
 
-       vbox4 = gtk_vbox_new( TRUE, 0 );
+       vbox4 = ui::VBox( TRUE, 0 );
        gtk_widget_set_name( vbox4, "vbox4" );
        gtk_widget_show( vbox4 );
        gtk_box_pack_start( GTK_BOX( hbox2 ), vbox4, TRUE, FALSE, 0 );
 
        r_collapse = gtk_radio_button_new_with_mnemonic( NULL, "Collapse mesh" );
        gtk_widget_set_name( r_collapse, "r_collapse" );
-       gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ), r_collapse, "Collapse all brushes into a single group", "Collapse all brushes into a single group" );
+       gtk_widget_set_tooltip_text(r_collapse, "Collapse all brushes into a single group");
        gtk_widget_show( r_collapse );
        gtk_box_pack_start( GTK_BOX( vbox4 ), r_collapse, FALSE, FALSE, 0 );
        gtk_radio_button_set_group( GTK_RADIO_BUTTON( r_collapse ), r_collapse_group );
@@ -74,7 +62,7 @@ create_w_plugplug2( void ){
 
        r_collapsebymaterial = gtk_radio_button_new_with_mnemonic( NULL, "Collapse by material" );
        gtk_widget_set_name( r_collapsebymaterial, "r_collapsebymaterial" );
-       gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ), r_collapsebymaterial, "Collapse into groups by material", "Collapse into groups by material" );
+       gtk_widget_set_tooltip_text(r_collapsebymaterial, "Collapse into groups by material");
        gtk_widget_show( r_collapsebymaterial );
        gtk_box_pack_start( GTK_BOX( vbox4 ), r_collapsebymaterial, FALSE, FALSE, 0 );
        gtk_radio_button_set_group( GTK_RADIO_BUTTON( r_collapsebymaterial ), r_collapse_group );
@@ -82,70 +70,70 @@ create_w_plugplug2( void ){
 
        r_nocollapse = gtk_radio_button_new_with_mnemonic( NULL, "Don't collapse" );
        gtk_widget_set_name( r_nocollapse, "r_nocollapse" );
-       gtk_tooltips_set_tip( GTK_TOOLTIPS( tooltips ), r_nocollapse, "Every brush is stored in its own group", "Every brush is stored in its own group" );
+       gtk_widget_set_tooltip_text(r_nocollapse, "Every brush is stored in its own group");
        gtk_widget_show( r_nocollapse );
        gtk_box_pack_start( GTK_BOX( vbox4 ), r_nocollapse, FALSE, FALSE, 0 );
        gtk_radio_button_set_group( GTK_RADIO_BUTTON( r_nocollapse ), r_collapse_group );
        r_collapse_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( r_nocollapse ) );
 
-       vbox3 = gtk_vbox_new( FALSE, 0 );
+       vbox3 = ui::VBox( FALSE, 0 );
        gtk_widget_set_name( vbox3, "vbox3" );
        gtk_widget_show( vbox3 );
        gtk_box_pack_start( GTK_BOX( hbox2 ), vbox3, FALSE, FALSE, 0 );
 
-       b_export = gtk_button_new_from_stock( "gtk-save" );
+       auto b_export = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-save" )));
        gtk_widget_set_name( b_export, "b_export" );
        gtk_widget_show( b_export );
        gtk_box_pack_start( GTK_BOX( vbox3 ), b_export, TRUE, FALSE, 0 );
        gtk_container_set_border_width( GTK_CONTAINER( b_export ), 5 );
 
-       b_close = gtk_button_new_from_stock( "gtk-cancel" );
+       auto b_close = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-cancel" )));
        gtk_widget_set_name( b_close, "b_close" );
        gtk_widget_show( b_close );
        gtk_box_pack_start( GTK_BOX( vbox3 ), b_close, TRUE, FALSE, 0 );
        gtk_container_set_border_width( GTK_CONTAINER( b_close ), 5 );
 
-       vbox2 = gtk_vbox_new( FALSE, 5 );
+       vbox2 = ui::VBox( FALSE, 5 );
        gtk_widget_set_name( vbox2, "vbox2" );
        gtk_widget_show( vbox2 );
        gtk_box_pack_start( GTK_BOX( vbox1 ), vbox2, TRUE, TRUE, 0 );
        gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 2 );
 
-       label1 = gtk_label_new( "Ignored materials:" );
+       label1 = ui::Label( "Ignored materials:" );
        gtk_widget_set_name( label1, "label1" );
        gtk_widget_show( label1 );
        gtk_box_pack_start( GTK_BOX( vbox2 ), label1, FALSE, FALSE, 0 );
 
-       scrolledwindow1 = gtk_scrolled_window_new( NULL, NULL );
+       auto scrolledwindow1 = ui::ScrolledWindow();
        gtk_widget_set_name( scrolledwindow1, "scrolledwindow1" );
-       gtk_widget_show( scrolledwindow1 );
+       scrolledwindow1.show();
        gtk_box_pack_start( GTK_BOX( vbox2 ), scrolledwindow1, TRUE, TRUE, 0 );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW( scrolledwindow1 ), GTK_SHADOW_IN );
 
-       t_materialist = gtk_tree_view_new();
+       auto t_materialist = ui::TreeView();
        gtk_widget_set_name( t_materialist, "t_materialist" );
-       gtk_widget_show( t_materialist );
-       gtk_container_add( GTK_CONTAINER( scrolledwindow1 ), t_materialist );
+       t_materialist.show();
+       scrolledwindow1.add(t_materialist);
        gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( t_materialist ), FALSE );
        gtk_tree_view_set_enable_search( GTK_TREE_VIEW( t_materialist ), FALSE );
 
-       ed_materialname = gtk_entry_new();
+       ed_materialname = ui::Entry();
        gtk_widget_set_name( ed_materialname, "ed_materialname" );
        gtk_widget_show( ed_materialname );
        gtk_box_pack_start( GTK_BOX( vbox2 ), ed_materialname, FALSE, FALSE, 0 );
 
-       hbox1 = gtk_hbox_new( TRUE, 0 );
+       hbox1 = ui::HBox( TRUE, 0 );
        gtk_widget_set_name( hbox1, "hbox1" );
        gtk_widget_show( hbox1 );
        gtk_box_pack_start( GTK_BOX( vbox2 ), hbox1, FALSE, FALSE, 0 );
 
-       b_addmaterial = gtk_button_new_from_stock( "gtk-add" );
+       auto b_addmaterial = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-add" )));
        gtk_widget_set_name( b_addmaterial, "b_addmaterial" );
        gtk_widget_show( b_addmaterial );
        gtk_box_pack_start( GTK_BOX( hbox1 ), b_addmaterial, FALSE, FALSE, 0 );
 
-       b_removematerial = gtk_button_new_from_stock( "gtk-remove" );
+       auto b_removematerial = ui::Button(GTK_BUTTON(gtk_button_new_from_stock( "gtk-remove" )));
        gtk_widget_set_name( b_removematerial, "b_removematerial" );
        gtk_widget_show( b_removematerial );
        gtk_box_pack_start( GTK_BOX( hbox1 ), b_removematerial, FALSE, FALSE, 0 );
@@ -160,20 +148,20 @@ create_w_plugplug2( void ){
        gtk_widget_show( t_objects );
        gtk_box_pack_end( GTK_BOX( vbox2 ), t_objects, FALSE, FALSE, 0 );
 
-       t_exportmaterials = gtk_check_button_new_with_mnemonic( "Create material information (.mtl file)" );
+       auto t_exportmaterials = ui::CheckButton(GTK_CHECK_BUTTON(gtk_check_button_new_with_mnemonic( "Create material information (.mtl file)" )));
        gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( t_exportmaterials ), true );
        gtk_widget_set_name( t_exportmaterials, "t_exportmaterials" );
        gtk_widget_show( t_exportmaterials );
        gtk_box_pack_end( GTK_BOX( vbox2 ), t_exportmaterials, FALSE, FALSE, 10 );
 
        using namespace callbacks;
-       g_signal_connect( G_OBJECT( w_plugplug2 ), "destroy", G_CALLBACK( OnDestroy ), NULL );
+       w_plugplug2.connect( "destroy", G_CALLBACK( OnDestroy ), NULL );
        g_signal_connect_swapped( G_OBJECT( b_close ), "clicked", G_CALLBACK( OnDestroy ), NULL );
 
-       g_signal_connect( ( gpointer )b_export, "clicked", G_CALLBACK( OnExportClicked ), NULL );
-       g_signal_connect( ( gpointer )b_addmaterial, "clicked", G_CALLBACK( OnAddMaterial ), NULL );
-       g_signal_connect( ( gpointer )b_removematerial, "clicked", G_CALLBACK( OnRemoveMaterial ), NULL );
-       g_signal_connect( ( gpointer )t_exportmaterials, "clicked", G_CALLBACK( OnExportMatClicked ), NULL );
+       b_export.connect( "clicked", G_CALLBACK( OnExportClicked ), NULL );
+       b_addmaterial.connect( "clicked", G_CALLBACK( OnAddMaterial ), NULL );
+       b_removematerial.connect( "clicked", G_CALLBACK( OnRemoveMaterial ), NULL );
+       t_exportmaterials.connect( "clicked", G_CALLBACK( OnExportMatClicked ), NULL );
 
        /* Store pointers to all widgets, for use by lookup_widget(). */
        GLADE_HOOKUP_OBJECT_NO_REF( w_plugplug2, w_plugplug2, "w_plugplug2" );
@@ -206,7 +194,7 @@ GtkWidget* g_brushexp_window = 0;
 
 // spawn plugin window (and make sure it got destroyed first or never created)
 void CreateWindow( void ){
-       ASSERT_NOTNULL( !g_brushexp_window );
+       ASSERT_TRUE( !g_brushexp_window );
 
        GtkWidget* wnd = create_w_plugplug2();
 
@@ -214,13 +202,13 @@ void CreateWindow( void ){
        GtkTreeViewColumn* col = gtk_tree_view_column_new();
        gtk_tree_view_column_set_title( col, "materials" );
        gtk_tree_view_append_column( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), col );
-       GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
+       auto renderer = ui::CellRendererText();
        gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), -1, "", renderer, "text", 0, NULL );
 
        // list store
-       GtkListStore* ignorelist = gtk_list_store_new( 1, G_TYPE_STRING );
+       ui::ListStore ignorelist = ui::ListStore(gtk_list_store_new( 1, G_TYPE_STRING ));
        gtk_tree_view_set_model( GTK_TREE_VIEW( lookup_widget( wnd, "t_materialist" ) ), GTK_TREE_MODEL( ignorelist ) );
-       g_object_unref( ignorelist );
+    ignorelist.unref();
 
        gtk_widget_show_all( wnd );
        g_brushexp_window = wnd;
index 274c840ee70f1947e408e6b360693ff148c78d9b..a2d0d6219333f0048243e5c86b411f2b0c847915 100644 (file)
@@ -24,7 +24,6 @@
 #include "qerplugin.h"
 
 #include <gtk/gtk.h>
-#include <gtk/gtktreeview.h>
 
 #include "debugging/debugging.h"
 #include "string/string.h"
@@ -50,11 +49,11 @@ bool IsWindowOpen( void );
 
 namespace BrushExport
 {
-GtkWindow* g_mainwnd;
+ui::Window g_mainwnd{ui::null};
 
 const char* init( void* hApp, void* pMainWidget ){
-       g_mainwnd = (GtkWindow*)pMainWidget;
-       ASSERT_NOTNULL( g_mainwnd );
+       g_mainwnd = ui::Window(GTK_WINDOW(pMainWidget));
+       ASSERT_TRUE( g_mainwnd );
        return "";
 }
 const char* getName(){
@@ -69,7 +68,7 @@ const char* getCommandTitleList(){
 
 void dispatch( const char* command, float* vMin, float* vMax, bool bSingleBrush ){
        if ( string_equal( command, "About" ) ) {
-               GlobalRadiant().m_pfnMessageBox( GTK_WIDGET( g_mainwnd ), "Brushexport plugin v 2.0 by namespace (www.codecreator.net)\n"
+               GlobalRadiant().m_pfnMessageBox( g_mainwnd, "Brushexport plugin v 2.0 by namespace (www.codecreator.net)\n"
                                                                                                                                  "Enjoy!\n\nSend feedback to spam@codecreator.net", "About me...",
                                                                                 eMB_OK,
                                                                                 eMB_ICONDEFAULT );
index 79c5e145b6939eb4ef6aa1f0a32b1fecc11e5679..768f213a6f77add162ccd54da793e1cfae97ebfe 100644 (file)
@@ -1,8 +1,9 @@
 #include <gtk/gtk.h>
+#include <uilib/uilib.h>
 
 #include "support.h"
 
-GtkWidget*
+ui::Widget
 lookup_widget( GtkWidget       *widget,
                           const gchar     *widget_name ){
        GtkWidget *parent, *found_widget;
@@ -13,7 +14,7 @@ lookup_widget( GtkWidget       *widget,
                        parent = gtk_menu_get_attach_widget( GTK_MENU( widget ) );
                }
                else{
-                       parent = widget->parent;
+                       parent = gtk_widget_get_parent(widget);
                }
                if ( !parent ) {
                        parent = (GtkWidget*) g_object_get_data( G_OBJECT( widget ), "GladeParentKey" );
@@ -29,5 +30,5 @@ lookup_widget( GtkWidget       *widget,
        if ( !found_widget ) {
                g_warning( "Widget not found: %s", widget_name );
        }
-       return found_widget;
+       return ui::Widget(found_widget);
 }
index e8f4cb045d5d75ba3d0fc308242c86cd49bae524..a5bd9655c8ba18947d45e993a3c4bf4a992ff3bb 100644 (file)
@@ -6,7 +6,7 @@
 #  include <config.h>
 #endif
 
-#include <gtk/gtk.h>
+#include <uilib/uilib.h>
 
 /*
  * Public Functions.
@@ -18,5 +18,5 @@
  * or alternatively any widget in the component, and the name of the widget
  * you want returned.
  */
-GtkWidget*  lookup_widget( GtkWidget       *widget,
+ui::Widget lookup_widget( GtkWidget       *widget,
                                                   const gchar     *widget_name );
index 896ca1be704687b94a6aee7453471df4ef530927..8f2091c555b464a005f0326eaf58a572e914e98c 100644 (file)
@@ -48,7 +48,6 @@ extern _QERQglTable __QGLTABLENAME;
 #include "bytebool.h"
 
 class CCamera;
-#include <gtk/gtk.h>
 
 #include "str.h"
 
index acd2fbd4fbda8cb08936ffc582d27a99669833c5..9425521dacee936324954769e3cd38cc9dfecc4f 100644 (file)
@@ -61,7 +61,7 @@ static gint ci_editmode_add( GtkWidget *widget, gpointer data ){
    }*/
 
 static gint ci_new( GtkWidget *widget, gpointer data ){
-       GtkWidget *window, *w, *vbox, *vbox2, *hbox, *frame; //, *name;
+       GtkWidget *w, *hbox; //, *name;
        GtkWidget *fixed, *interpolated, *spline;
        EMessageBoxReturn ret;
        int loop = 1;
@@ -69,10 +69,10 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
 //     char buf[128];
 
        // create the window
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
        gtk_window_set_title( GTK_WINDOW( window ), "New Camera" );
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
        gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
@@ -81,22 +81,22 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
        gtk_widget_realize( window );
 
        // fill the window
-       vbox = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 5 );
+       window.add(vbox);
+       vbox.show();
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       frame = gtk_frame_new( "Type" );
+       auto frame = ui::Frame( "Type" );
        gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
        gtk_widget_show( frame );
 
-       vbox2 = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox2 );
+       auto vbox2 = ui::VBox( FALSE, 5 );
+       frame.add(vbox2);
        gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 );
        gtk_widget_show( vbox2 );
 
@@ -105,17 +105,17 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
        fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 );
        gtk_widget_show( fixed );
-       targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) );
+       targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) );
 
        interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 );
        gtk_widget_show( interpolated );
-       targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) );
+       targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) );
 
        spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 );
        gtk_widget_show( spline );
-       targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) );
+       targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) );
 
        // -------------------------- //
 
@@ -125,21 +125,21 @@ static gint ci_new( GtkWidget *widget, gpointer data ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "Ok" );
+       w = ui::Button( "Ok" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -314,7 +314,7 @@ static gint ci_pathlist_changed( GtkWidget *widget, gpointer data ){
        }
 
        // start edit mode
-       if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) {
+       if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) {
                DoStartEdit( GetCurrentCam() );
        }
 
@@ -353,7 +353,7 @@ static void RefreshEventList( void ){
 }
 
 static gint ci_rename( GtkWidget *widget, gpointer data ){
-       GtkWidget *window, *w, *vbox, *hbox, *name;
+       GtkWidget *w, *hbox, *name;
        EMessageBoxReturn ret;
        int loop = 1;
 
@@ -362,10 +362,10 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){
        }
 
        // create the window
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
        gtk_window_set_title( GTK_WINDOW( window ), "Rename Path" );
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
        gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
@@ -374,21 +374,21 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){
        gtk_widget_realize( window );
 
        // fill the window
-       vbox = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 5 );
+       window.add(vbox);
+       vbox.show();
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Name:" );
+       w = ui::Label( "Name:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       name = gtk_entry_new();
+       name = ui::Entry();
        gtk_box_pack_start( GTK_BOX( hbox ), name, FALSE, FALSE, 0 );
        gtk_widget_show( name );
 
@@ -407,21 +407,21 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "Ok" );
+       w = ui::Button( "Ok" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -469,7 +469,7 @@ static gint ci_rename( GtkWidget *widget, gpointer data ){
 }
 
 static gint ci_add_target( GtkWidget *widget, gpointer data ){
-       GtkWidget *window, *w, *vbox, *vbox2, *hbox, *frame, *name;
+       GtkWidget *w, *hbox, *name;
        GtkWidget *fixed, *interpolated, *spline;
        EMessageBoxReturn ret;
        int loop = 1;
@@ -481,10 +481,10 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
        }
 
        // create the window
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
        gtk_window_set_title( GTK_WINDOW( window ), "Add Target" );
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
        gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
@@ -493,21 +493,21 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
        gtk_widget_realize( window );
 
        // fill the window
-       vbox = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 5 );
+       window.add(vbox);
+       vbox.show();
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Name:" );
+       w = ui::Label( "Name:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       name = gtk_entry_new();
+       name = ui::Entry();
        gtk_box_pack_start( GTK_BOX( hbox ), name, TRUE, TRUE, 0 );
        gtk_widget_show( name );
 
@@ -516,16 +516,16 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       frame = gtk_frame_new( "Type" );
+       auto frame = ui::Frame( "Type" );
        gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
        gtk_widget_show( frame );
 
-       vbox2 = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox2 );
+       auto vbox2 = ui::VBox( FALSE, 5 );
+       frame.add(vbox2);
        gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 );
        gtk_widget_show( vbox2 );
 
@@ -534,17 +534,17 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
        fixed = gtk_radio_button_new_with_label( targetTypeRadio, "Fixed" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), fixed, FALSE, FALSE, 3 );
        gtk_widget_show( fixed );
-       targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( fixed ) );
+       targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( fixed ) );
 
        interpolated = gtk_radio_button_new_with_label( targetTypeRadio, "Interpolated" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), interpolated, FALSE, FALSE, 3 );
        gtk_widget_show( interpolated );
-       targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( interpolated ) );
+       targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( interpolated ) );
 
        spline = gtk_radio_button_new_with_label( targetTypeRadio, "Spline" );
        gtk_box_pack_start( GTK_BOX( vbox2 ), spline, FALSE, FALSE, 3 );
        gtk_widget_show( spline );
-       targetTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( spline ) );
+       targetTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( spline ) );
 
        // -------------------------- //
 
@@ -554,21 +554,21 @@ static gint ci_add_target( GtkWidget *widget, gpointer data ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "Ok" );
+       w = ui::Button( "Ok" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -756,7 +756,7 @@ static gint ci_camlist_changed( GtkWidget *widget, gpointer data ){
 
        // start edit mode
        g_iActiveTarget = -1;
-       if ( g_pCameraInspectorWnd && GTK_WIDGET_VISIBLE( g_pCameraInspectorWnd ) ) {
+       if ( g_pCameraInspectorWnd && gtk_widget_get_visible( g_pCameraInspectorWnd ) ) {
                DoStartEdit( GetCurrentCam() );
        }
 
@@ -817,7 +817,7 @@ const char *camEventStr[] = {
 };
 
 static gint ci_add( GtkWidget *widget, gpointer data ){
-       GtkWidget *window, *w, *vbox, *vbox2, *hbox, *frame, *parameters;
+       GtkWidget *w, *hbox, *parameters;
        GtkWidget *eventWidget[EVENT_COUNT];
        EMessageBoxReturn ret;
        int i, loop = 1;
@@ -829,10 +829,10 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
        }
 
        // create the window
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
        gtk_window_set_title( GTK_WINDOW( window ), "Add Event" );
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( dialog_delete_callback ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( dialog_delete_callback ), NULL );
+       window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
        gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pCameraInspectorWnd ) );
 
        g_object_set_data( G_OBJECT( window ), "loop", &loop );
@@ -841,22 +841,22 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
        gtk_widget_realize( window );
 
        // fill the window
-       vbox = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( window ), vbox );
-       gtk_widget_show( vbox );
+       auto vbox = ui::VBox( FALSE, 5 );
+       window.add(vbox);
+       vbox.show();
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       frame = gtk_frame_new( "Type" );
+       auto frame = ui::Frame( "Type" );
        gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
        gtk_widget_show( frame );
 
-       vbox2 = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox2 );
+       auto vbox2 = ui::VBox( FALSE, 5 );
+       frame.add(vbox2);
        gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 );
        gtk_widget_show( vbox2 );
 
@@ -866,7 +866,7 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
                eventWidget[i] = gtk_radio_button_new_with_label( eventTypeRadio, camEventStr[i] );
                gtk_box_pack_start( GTK_BOX( vbox2 ), eventWidget[i], FALSE, FALSE, 3 );
                gtk_widget_show( eventWidget[i] );
-               eventTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( eventWidget[i] ) );
+               eventTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( eventWidget[i] ) );
                if ( camEventFlags[i][1] == false ) {
                        gtk_widget_set_sensitive( eventWidget[i], FALSE );
                }
@@ -874,15 +874,15 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Parameters:" );
+       w = ui::Label( "Parameters:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       parameters = gtk_entry_new();
+       parameters = ui::Entry();
        gtk_box_pack_start( GTK_BOX( hbox ), parameters, TRUE, TRUE, 0 );
        gtk_widget_show( parameters );
 
@@ -894,21 +894,21 @@ static gint ci_add( GtkWidget *widget, gpointer data ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "Ok" );
+       w = ui::Button( "Ok" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDOK ) );
        gtk_widget_show( w );
 
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
 
-       w = gtk_button_new_with_label( "Cancel" );
+       w = ui::Button( "Cancel" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
+       w.connect( "clicked", G_CALLBACK( dialog_button_callback ), GINT_TO_POINTER( eIDCANCEL ) );
        gtk_widget_show( w );
        ret = eIDCANCEL;
 
@@ -992,14 +992,14 @@ static gint ci_timeline_changed( GtkAdjustment *adjustment ){
 }
 
 GtkWidget *CreateCameraInspectorDialog( void ){
-       GtkWidget *window, *w, *vbox, *hbox, *table, *frame;
+       GtkWidget *w, *hbox;
 
        // create the window
-       window = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto window = ui::Window( ui::window_type::TOP );
        gtk_window_set_title( GTK_WINDOW( window ), "Camera Inspector" );
-       gtk_signal_connect( GTK_OBJECT( window ), "delete_event", GTK_SIGNAL_FUNC( ci_close ), NULL );
-       gtk_signal_connect( GTK_OBJECT( window ), "expose_event", GTK_SIGNAL_FUNC( ci_expose ), NULL );
-       //  gtk_signal_connect( GTK_OBJECT (window), "destroy", GTK_SIGNAL_FUNC( gtk_widget_destroy ), NULL );
+       window.connect( "delete_event", G_CALLBACK( ci_close ), NULL );
+       window.connect( "expose_event", G_CALLBACK( ci_expose ), NULL );
+       //  window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );
        gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) );
 
        // don't use show, as you don't want to have it displayed on startup ;-)
@@ -1010,9 +1010,9 @@ GtkWidget *CreateCameraInspectorDialog( void ){
        // the table
        // -------------------------- //
 
-       table = gtk_table_new( 3, 2, FALSE );
-       gtk_widget_show( table );
-       gtk_container_add( GTK_CONTAINER( window ), table );
+       auto table = ui::Table( 3, 2, FALSE );
+       table.show();
+       window.add(table);
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
@@ -1020,7 +1020,7 @@ GtkWidget *CreateCameraInspectorDialog( void ){
        // the properties column
        // -------------------------- //
 
-       vbox = gtk_vbox_new( FALSE, 5 );
+       vbox = ui::VBox( FALSE, 5 );
        gtk_widget_show( vbox );
        gtk_table_attach( GTK_TABLE( table ), vbox, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1028,11 +1028,11 @@ GtkWidget *CreateCameraInspectorDialog( void ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "File:" );
+       w = ui::Label( "File:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
@@ -1042,52 +1042,52 @@ GtkWidget *CreateCameraInspectorDialog( void ){
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Name:" );
+       w = ui::Label( "Name:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       g_pCamName = gtk_entry_new();
+       g_pCamName = ui::Entry();
        gtk_box_pack_start( GTK_BOX( hbox ), g_pCamName, FALSE, FALSE, 0 );
        gtk_widget_show( g_pCamName );
 
-       w = gtk_label_new( "Type: " );
+       w = ui::Label( "Type: " );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       w = gtk_label_new( "" );
+       w = ui::Label( "" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
        g_pCamType = GTK_LABEL( w );
 
        RefreshCamListCombo();
 
-       gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pCamListCombo )->entry ), FALSE );
-       gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pCamListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_camlist_changed ), NULL );
+       gtk_editable_set_editable( GTK_EDITABLE( GTK_COMBO( g_pCamListCombo )->entry ), FALSE );
+       ( GTK_COMBO( g_pCamListCombo )->entry ).connect( "changed", G_CALLBACK( ci_camlist_changed ), NULL );
 
        // -------------------------- //
 
-       frame = gtk_frame_new( "Path and Target editing" );
-       gtk_widget_show( frame );
+       auto frame = ui::Frame( "Path and Target editing" );
+       frame.show();
        gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       vbox = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox );
+       auto vbox = ui::VBox( FALSE, 5 );
+       frame.add(vbox);
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
-       gtk_widget_show( vbox );
+       vbox.show();
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Edit:" );
+       w = ui::Label( "Edit:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
@@ -1097,28 +1097,28 @@ GtkWidget *CreateCameraInspectorDialog( void ){
 
        RefreshPathListCombo();
 
-       gtk_entry_set_editable( GTK_ENTRY( GTK_COMBO( g_pPathListCombo )->entry ), FALSE );
-       gtk_signal_connect( GTK_OBJECT( GTK_COMBO( g_pPathListCombo )->entry ), "changed", GTK_SIGNAL_FUNC( ci_pathlist_changed ), NULL );
+       gtk_editable_set_editable( GTK_EDITABLE( GTK_COMBO( g_pPathListCombo )->entry ), FALSE );
+       ( GTK_COMBO( g_pPathListCombo )->entry ).connect( "changed", G_CALLBACK( ci_pathlist_changed ), NULL );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
        g_pEditModeEditRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, "Edit Points" );
        gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeEditRadioButton, FALSE, FALSE, 3 );
        gtk_widget_show( g_pEditModeEditRadioButton );
-       g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) );
+       g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeEditRadioButton ) );
 
-       gtk_signal_connect( GTK_OBJECT( g_pEditModeEditRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_edit ), NULL );
+       g_pEditModeEditRadioButton.connect( "clicked", G_CALLBACK( ci_editmode_edit ), NULL );
 
        g_pEditModeAddRadioButton = gtk_radio_button_new_with_label( g_pEditTypeRadio, "Add Points" );
        gtk_box_pack_start( GTK_BOX( hbox ), g_pEditModeAddRadioButton, FALSE, FALSE, 3 );
        gtk_widget_show( g_pEditModeAddRadioButton );
-       g_pEditTypeRadio = gtk_radio_button_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) );
+       g_pEditTypeRadio = gtk_radio_button_get_group( GTK_RADIO_BUTTON( g_pEditModeAddRadioButton ) );
 
-       gtk_signal_connect( GTK_OBJECT( g_pEditModeAddRadioButton ), "clicked", GTK_SIGNAL_FUNC( ci_editmode_add ), NULL );
+       g_pEditModeAddRadioButton.connect( "clicked", G_CALLBACK( ci_editmode_add ), NULL );
 
        // see if we should use a different default
        if ( g_iEditMode == 1 ) {
@@ -1126,141 +1126,141 @@ GtkWidget *CreateCameraInspectorDialog( void ){
                gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( g_pEditModeAddRadioButton ), TRUE );
        }
 
-       w = gtk_label_new( "Type: " );
+       w = ui::Label( "Type: " );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       w = gtk_label_new( "" );
+       w = ui::Label( "" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
        g_pPathType = GTK_LABEL( w );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_button_new_with_label( "Rename..." );
+       w = ui::Button( "Rename..." );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_rename ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_rename ), NULL );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Add Target..." );
+       w = ui::Button( "Add Target..." );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add_target ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_add_target ), NULL );
        gtk_widget_show( w );
 
        // not available in splines library
        /*w = gtk_button_new_with_label( "Delete Selected" );
           gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0);
-          gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_delete_selected ), NULL );
+          w.connect( "clicked", G_CALLBACK( ci_delete_selected ), NULL );
           gtk_widget_show( w );
 
           w = gtk_button_new_with_label( "Select All" );
           gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, TRUE, 0);
-          gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_select_all ), NULL );
+          w.connect( "clicked", G_CALLBACK( ci_select_all ), NULL );
           gtk_widget_show( w );*/
 
        // -------------------------- //
 
-       frame = gtk_frame_new( "Time" );
+       frame = ui::Frame( "Time" );
        gtk_widget_show( frame );
        gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       vbox = gtk_vbox_new( FALSE, 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox );
+       vbox = ui::VBox( FALSE, 5 );
+       frame.add(vbox);
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
-       gtk_widget_show( vbox );
+       vbox.show();
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Length (seconds):" );
+       w = ui::Label( "Length (seconds):" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       g_pSecondsEntry = gtk_entry_new();
+       g_pSecondsEntry = ui::Entry();
        gtk_box_pack_start( GTK_BOX( hbox ), g_pSecondsEntry, FALSE, FALSE, 0 );
        gtk_widget_show( g_pSecondsEntry );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Current Time: " );
+       w = ui::Label( "Current Time: " );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       w = gtk_label_new( "0.00" );
+       w = ui::Label( "0.00" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
        g_pCurrentTime = GTK_LABEL( w );
 
-       w = gtk_label_new( " of " );
+       w = ui::Label( " of " );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
-       w = gtk_label_new( "0.00" );
+       w = ui::Label( "0.00" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
        g_pTotalTime = GTK_LABEL( w );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       g_pTimeLine = GTK_ADJUSTMENT( gtk_adjustment_new( 0, 0, 30000, 100, 250, 0 ) );
-       gtk_signal_connect( GTK_OBJECT( g_pTimeLine ), "value_changed", GTK_SIGNAL_FUNC( ci_timeline_changed ), NULL );
-       w = gtk_hscale_new( g_pTimeLine );
+       g_pTimeLine = ui::Adjustment( 0, 0, 30000, 100, 250, 0 );
+       g_pTimeLine.connect( "value_changed", G_CALLBACK( ci_timeline_changed ), NULL );
+       w = ui::HScale( g_pTimeLine );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_widget_show( w );
        gtk_scale_set_draw_value( GTK_SCALE( w ), FALSE );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       g_pTrackCamera = gtk_check_button_new_with_label( "Track Camera" );
+       g_pTrackCamera = ui::CheckButton( "Track Camera" );
        gtk_box_pack_start( GTK_BOX( hbox ), g_pTrackCamera, FALSE, FALSE, 0 );
        gtk_widget_show( g_pTrackCamera );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_label_new( "Events:" );
+       w = ui::Label( "Events:" );
        gtk_box_pack_start( GTK_BOX( hbox ), w, FALSE, FALSE, 0 );
        gtk_widget_show( w );
 
        // -------------------------- //
 
-       hbox = gtk_hbox_new( FALSE, 5 );
+       hbox = ui::HBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
        gtk_widget_show( hbox );
 
-       w = gtk_scrolled_window_new( NULL, NULL );
-       gtk_widget_set_usize( w, 0, 150 );
+       auto scr = w = ui::ScrolledWindow();
+       gtk_widget_set_size_request( w, 0, 150 );
        gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( w ), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
        gtk_box_pack_start( GTK_BOX( hbox ), w, TRUE, TRUE, 0 );
        gtk_widget_show( w );
 
        g_pEventsList = gtk_clist_new( 3 );
-       gtk_container_add( GTK_CONTAINER( w ), g_pEventsList );
-       //gtk_signal_connect( GTK_OBJECT(g_pEventsList), "select_row", GTK_SIGNAL_FUNC (proplist_select_row), NULL);
+       scr.add(g_pEventsList);
+       //g_pEventsList.connect( "select_row", G_CALLBACK (proplist_select_row), NULL);
        gtk_clist_set_selection_mode( GTK_CLIST( g_pEventsList ), GTK_SELECTION_BROWSE );
        gtk_clist_column_titles_hide( GTK_CLIST( g_pEventsList ) );
        gtk_clist_set_column_auto_resize( GTK_CLIST( g_pEventsList ), 0, TRUE );
@@ -1268,18 +1268,18 @@ GtkWidget *CreateCameraInspectorDialog( void ){
        gtk_clist_set_column_auto_resize( GTK_CLIST( g_pEventsList ), 2, TRUE );
        gtk_widget_show( g_pEventsList );
 
-       vbox = gtk_vbox_new( FALSE, 5 );
+       vbox = ui::VBox( FALSE, 5 );
        gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, FALSE, 0 );
        gtk_widget_show( vbox );
 
-       w = gtk_button_new_with_label( "Add..." );
+       w = ui::Button( "Add..." );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_add ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_add ), NULL );
        gtk_widget_show( w );
 
-       w = gtk_button_new_with_label( "Del" );
+       w = ui::Button( "Del" );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_del ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_del ), NULL );
        gtk_widget_show( w );
 
        // -------------------------- //
@@ -1301,12 +1301,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){
 
        w = gtk_button_new_with_label( "New..." );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_new ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_new ), NULL );
        gtk_widget_show( w );
 
        w = gtk_button_new_with_label( "Load..." );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_load ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_load ), NULL );
        gtk_widget_show( w );
 
        // -------------------------- //
@@ -1319,12 +1319,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){
 
        w = gtk_button_new_with_label( "Save..." );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_save ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_save ), NULL );
        gtk_widget_show( w );
 
        w = gtk_button_new_with_label( "Unload" );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_unload ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_unload ), NULL );
        gtk_widget_show( w );
 
        hbox = gtk_hbox_new( FALSE, 5 );
@@ -1333,12 +1333,12 @@ GtkWidget *CreateCameraInspectorDialog( void ){
 
        w = gtk_button_new_with_label( "Apply" );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_apply ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_apply ), NULL );
        gtk_widget_show( w );
 
        w = gtk_button_new_with_label( "Preview" );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_preview ), NULL );
+       w.connect( "clicked", G_CALLBACK( ci_preview ), NULL );
        gtk_widget_show( w );
 
        // -------------------------- //
@@ -1355,8 +1355,8 @@ GtkWidget *CreateCameraInspectorDialog( void ){
 
        w = gtk_button_new_with_label( "Close" );
        gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
-       gtk_signal_connect( GTK_OBJECT( w ), "clicked", GTK_SIGNAL_FUNC( ci_close ), NULL );
-       GTK_WIDGET_SET_FLAGS( w, GTK_CAN_DEFAULT );
+       w.connect( "clicked", G_CALLBACK( ci_close ), NULL );
+       gtk_widget_set_can_default( w, true );
        gtk_widget_grab_default( w );
        gtk_widget_show( w );
 
index bfaf98490eb3f7fe3649502775c07f4d52775bb3..881de8af951413ce5a9afc2cd707046131baedaf 100644 (file)
@@ -1344,9 +1344,9 @@ void create_tooltips(){
 // create main dialog
 
 GtkWidget* create_main_dialog(){
-       GtkWidget *dlg, *vbox, *hbox, *hbox2, *button, *notebook, *frame, *table, *table2;
+       GtkWidget *hbox2, *button, *notebook, *table2;
        GtkWidget *check, *spin, *radio, *label, *entry, *scale;
-       GtkObject *adj;
+       ui::Adjustment adj;
        GSList *group;
        int i;
        const char *games[] = { "Quake 2", "Half-Life", "SiN", "Heretic 2", "Kingpin", "Genesis3D", "Quake 3 Arena" };
@@ -1355,44 +1355,44 @@ GtkWidget* create_main_dialog(){
        const char *orientations[] = { "Ground surface", "Ceiling", "Wall facing 0", "Wall facing 90",
                                                                   "Wall facing 180","Wall facing 270" };
 
-       g_pWnd = dlg = gtk_window_new( GTK_WINDOW_TOPLEVEL );
+       auto dlg = g_pWnd = ui::Window( ui::window_type::TOP );
        gtk_window_set_title( GTK_WINDOW( dlg ), gszCaption );
-       g_signal_connect( G_OBJECT( dlg ), "delete_event", G_CALLBACK( main_close ), NULL );
-       //  g_signal_connect (G_OBJECT (dlg), "destroy", G_CALLBACK (gtk_widget_destroy), NULL);
+       dlg.connect( "delete_event", G_CALLBACK( main_close ), NULL );
+       //  dlg.connect( "destroy", G_CALLBACK (gtk_widget_destroy), NULL);
        gtk_window_set_transient_for( GTK_WINDOW( dlg ), GTK_WINDOW( g_pRadiantWnd ) );
 
-       hbox = gtk_hbox_new( FALSE, 5 );
-       gtk_widget_show( hbox );
-       gtk_container_add( GTK_CONTAINER( dlg ), hbox );
+       auto hbox = ui::HBox( FALSE, 5 );
+       hbox.show();
+       dlg.add(hbox);
        gtk_container_set_border_width( GTK_CONTAINER( hbox ), 5 );
 
        notebook = gtk_notebook_new();
        gtk_widget_show( notebook );
        gtk_box_pack_start( GTK_BOX( hbox ), notebook, TRUE, TRUE, 0 );
-       g_signal_connect( G_OBJECT( notebook ), "switch_page",
+       notebook.connect( "switch_page",
                                          G_CALLBACK( switch_page ), NULL );
        gtk_notebook_set_tab_pos( GTK_NOTEBOOK( notebook ), GTK_POS_TOP );
        g_object_set_data( G_OBJECT( dlg ), "notebook", notebook );
 
-       table = gtk_table_new( 2, 2, FALSE );
+       table = ui::Table( 2, 2, FALSE );
        gtk_widget_show( table );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "General" );
+       label = ui::Label( "General" );
        gtk_widget_show( label );
        gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), table, label );
 
-       frame = gtk_frame_new( "Game" );
+       auto frame = ui::Frame( "Game" );
        gtk_widget_show( frame );
        gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 
-       vbox = gtk_vbox_new( TRUE, 5 );
-       gtk_widget_show( vbox );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox );
+       auto vbox = ui::VBox( TRUE, 5 );
+       vbox.show();
+       frame.add(vbox);
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
        for ( i = 0, group = NULL; i < NUMGAMES; i++ )
@@ -1400,20 +1400,20 @@ GtkWidget* create_main_dialog(){
                radio = gtk_radio_button_new_with_label( group, games[i] );
                gtk_widget_show( radio );
                gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
-               group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) );
+               group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
                game_radios[i] = radio;
-               g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) );
+               radio.connect( "toggled", G_CALLBACK( general_game ), GINT_TO_POINTER( i ) );
        }
 
-       frame = gtk_frame_new( "Waveform" );
+       frame = ui::Frame( "Waveform" );
        gtk_widget_show( frame );
        gtk_table_attach( GTK_TABLE( table ), frame, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 
-       vbox = gtk_vbox_new( TRUE, 5 );
-       gtk_widget_show( vbox );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox );
+       vbox = ui::VBox( TRUE, 5 );
+       vbox.show();
+       frame.add(vbox);
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
        for ( i = 0, group = NULL; i < 5; i++ )
@@ -1421,20 +1421,20 @@ GtkWidget* create_main_dialog(){
                radio = gtk_radio_button_new_with_label( group, waveforms[i] );
                gtk_widget_show( radio );
                gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
-               group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) );
+               group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
                wave_radios[i] = radio;
-               g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) );
+               radio.connect( "toggled", G_CALLBACK( general_wave ), GINT_TO_POINTER( i ) );
        }
 
-       frame = gtk_frame_new( "Orientation" );
+       frame = ui::Frame( "Orientation" );
        gtk_widget_show( frame );
        gtk_table_attach( GTK_TABLE( table ), frame, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 
-       vbox = gtk_vbox_new( TRUE, 5 );
-       gtk_widget_show( vbox );
-       gtk_container_add( GTK_CONTAINER( frame ), vbox );
+       vbox = ui::VBox( TRUE, 5 );
+       vbox.show();
+       frame.add(vbox);
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
        for ( i = 0, group = NULL; i < 6; i++ )
@@ -1442,12 +1442,12 @@ GtkWidget* create_main_dialog(){
                radio = gtk_radio_button_new_with_label( group, orientations[i] );
                gtk_widget_show( radio );
                gtk_box_pack_start( GTK_BOX( vbox ), radio, TRUE, TRUE, 0 );
-               group = gtk_radio_button_group( GTK_RADIO_BUTTON( radio ) );
+               group = gtk_radio_button_get_group( GTK_RADIO_BUTTON( radio ) );
                plane_radios[i] = radio;
-               g_signal_connect( G_OBJECT( radio ), "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) );
+               radio.connect( "toggled", G_CALLBACK( general_plane ), GINT_TO_POINTER( i ) );
        }
 
-       table2 = gtk_table_new( 4, 2, FALSE );
+       table2 = ui::Table( 4, 2, FALSE );
        gtk_widget_show( table2 );
        gtk_table_set_row_spacings( GTK_TABLE( table2 ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table2 ), 5 );
@@ -1455,7 +1455,7 @@ GtkWidget* create_main_dialog(){
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 
-       label = gtk_label_new( "Wavelength:" );
+       label = ui::Label( "Wavelength:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1463,7 +1463,7 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_RIGHT );
 
-       label = gtk_label_new( "Max. amplitude:" );
+       label = ui::Label( "Max. amplitude:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1471,7 +1471,7 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_RIGHT );
 
-       label = gtk_label_new( "Roughness:" );
+       label = ui::Label( "Roughness:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1479,7 +1479,7 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_RIGHT );
 
-       label = gtk_label_new( "Random seed:" );
+       label = ui::Label( "Random seed:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table2 ), label, 0, 1, 3, 4,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
@@ -1487,368 +1487,368 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_RIGHT );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "wavelength", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &WaveLength );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "amplitude", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Amplitude );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table2 ), entry, 1, 2, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "roughness", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Roughness );
 
-       adj = gtk_adjustment_new( 1, 1, 32767, 1, 10, 0 );
-       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( general_random ), NULL );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       adj = ui::Adjustment( 1, 1, 32767, 1, 10, 0 );
+       adj.connect( "value_changed", G_CALLBACK( general_random ), NULL );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table2 ), spin, 1, 2, 3, 4,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( spin, 60, -2 );
+       gtk_widget_set_size_request( spin, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "random", spin );
 
-       vbox = gtk_vbox_new( FALSE, 5 );
+       vbox = ui::VBox( FALSE, 5 );
        gtk_widget_show( vbox );
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
-       label = gtk_label_new( "Extents" );
+       label = ui::Label( "Extents" );
        gtk_widget_show( label );
        gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), vbox, label );
 
-       hbox2 = gtk_hbox_new( FALSE, 5 );
+       hbox2 = ui::HBox( FALSE, 5 );
        gtk_widget_show( hbox2 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 0 );
 
-       frame = gtk_frame_new( "Extents" );
+       frame = ui::Frame( "Extents" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 );
 
-       table = gtk_table_new( 3, 4, FALSE );
-       gtk_widget_show( table );
+       auto table = ui::Table( 3, 4, FALSE );
+       table.show();
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "X:" );
+       label = ui::Label( "X:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "hmin_text", label );
 
-       label = gtk_label_new( "X:" );
+       label = ui::Label( "X:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "hmax_text", label );
 
-       label = gtk_label_new( "Y:" );
+       label = ui::Label( "Y:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "vmin_text", label );
 
-       label = gtk_label_new( "Y:" );
+       label = ui::Label( "Y:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 2, 3,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "vmax_text", label );
 
-       label = gtk_label_new( "Lower-left" );
+       label = ui::Label( "Lower-left" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       label = gtk_label_new( "Upper-right" );
+       label = ui::Label( "Upper-right" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 3, 4, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "hmin", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hll );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hll );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "hmax", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hur );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Hur );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "vmin", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vll );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vll );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "vmax", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Vur );
 
-       frame = gtk_frame_new( "Divisions" );
+       frame = ui::Frame( "Divisions" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( hbox2 ), frame, TRUE, TRUE, 0 );
 
-       table = gtk_table_new( 2, 2, FALSE );
-       gtk_widget_show( table );
+       table = ui::Table( 2, 2, FALSE );
+       table.show();
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "X:" );
+       label = ui::Label( "X:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "nh_text", label );
 
-       label = gtk_label_new( "Y:" );
+       label = ui::Label( "Y:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "nv_text", label );
 
-       adj = gtk_adjustment_new( 8, 1, MAX_ROWS, 1, 10, 0 );
-       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NH );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
+       adj.connect( "value_changed", G_CALLBACK( extents_nhnv_spin ), &NH );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( spin, 60, -2 );
+       gtk_widget_set_size_request( spin, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "nh", spin );
 
-       adj = gtk_adjustment_new( 8, 1, MAX_ROWS, 1, 10, 0 );
-       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_nhnv_spin ), &NV );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       adj = ui::Adjustment( 8, 1, MAX_ROWS, 1, 10, 0 );
+       adj.connect( "value_changed", G_CALLBACK( extents_nhnv_spin ), &NV );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( spin, 60, -2 );
+       gtk_widget_set_size_request( spin, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "nv", spin );
 
-       check = gtk_check_button_new_with_label( "Use Bezier patches" );
+       check = ui::CheckButton( "Use Bezier patches" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "use_patches", check );
-       g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( extents_use_patches ), NULL );
+       check.connect( "toggled", G_CALLBACK( extents_use_patches ), NULL );
 
        // ^Fishman - Snap to grid, replaced scroll bar with a texbox.
-       label = gtk_label_new( "Snap to grid:" );
+       label = ui::Label( "Snap to grid:" );
        gtk_widget_show( label );
        gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
        gtk_object_set_data( GTK_OBJECT( dlg ), "snap_text", label );
 
-       adj = gtk_adjustment_new( 8, 0, 256, 1, 10, 0 );
-       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       adj = ui::Adjustment( 8, 0, 256, 1, 10, 0 );
+       adj.connect( "value_changed", G_CALLBACK( extents_snaptogrid_spin ), &SP );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_box_pack_start( GTK_BOX( vbox ), spin, FALSE, TRUE, 0 );
-       gtk_widget_set_usize( spin, 60, -2 );
+       gtk_widget_set_size_request( spin, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "sp", spin );
        // ^Fishman - End of Snap to grid code.
 
-       hbox2 = gtk_hbox_new( FALSE, 5 );
+       hbox2 = ui::HBox( FALSE, 5 );
        gtk_widget_show( hbox2 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 10 );
 
-       label = gtk_label_new( "Decimate:" );
+       label = ui::Label( "Decimate:" );
        gtk_widget_show( label );
        gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
 
-       adj = gtk_adjustment_new( 0, 0, 110, 1, 10, 0 );
-       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( extents_decimate ), NULL );
+       adj = ui::Adjustment( 0, 0, 110, 1, 10, 0 );
+       adj.connect( "value_changed", G_CALLBACK( extents_decimate ), NULL );
        g_object_set_data( G_OBJECT( dlg ), "decimate_adj", adj );
-       scale = gtk_hscale_new( GTK_ADJUSTMENT( adj ) );
+       scale = ui::HScale( adj );
        gtk_widget_show( scale );
        gtk_box_pack_start( GTK_BOX( hbox2 ), scale, TRUE, TRUE, 0 );
        gtk_scale_set_value_pos( GTK_SCALE( scale ), GTK_POS_RIGHT );
        gtk_scale_set_digits( GTK_SCALE( scale ), 0 );
        g_object_set_data( G_OBJECT( dlg ), "decimate", scale );
 
-       frame = gtk_frame_new( "Corner values" );
+       frame = ui::Frame( "Corner values" );
        gtk_widget_show( frame );
        gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 3, 4, FALSE );
-       gtk_widget_show( table );
+       table = ui::Table( 3, 4, FALSE );
+       table.show();
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
-       gtk_container_add( GTK_CONTAINER( frame ), table );
+       frame.add(table);
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "Upper-left:" );
+       label = ui::Label( "Upper-left:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       label = gtk_label_new( "Lower-left:" );
+       label = ui::Label( "Lower-left:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       label = gtk_label_new( "Upper-right:" );
+       label = ui::Label( "Upper-right:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       label = gtk_label_new( "Lower-right:" );
+       label = ui::Label( "Lower-right:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "z01", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z01 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "z00", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z00 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "z11", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z11 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "z10", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &Z10 );
 
-       check = gtk_check_button_new_with_label( "Linear borders" );
+       check = ui::CheckButton( "Linear borders" );
        gtk_widget_show( check );
        gtk_table_attach( GTK_TABLE( table ), check, 0, 4, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "linearborder", check );
-       g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( extents_linearborder ), NULL );
+       check.connect( "toggled", G_CALLBACK( extents_linearborder ), NULL );
 
-       vbox = gtk_vbox_new( FALSE, 10 );
+       vbox = ui::VBox( FALSE, 10 );
        gtk_widget_show( vbox );
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
-       label = gtk_label_new( "Bitmap" );
+       label = ui::Label( "Bitmap" );
        gtk_widget_show( label );
        gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), vbox, label );
 
-       label = gtk_label_new( "" );
+       label = ui::Label( "" );
        gtk_widget_show( label );
        gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "bmp_note", label );
 
-       table = gtk_table_new( 2, 2, FALSE );
+       table = ui::Table( 2, 2, FALSE );
        gtk_widget_show( table );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "Filename:" );
+       label = ui::Label( "Filename:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "bmp_text1", label );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        g_object_set_data( G_OBJECT( dlg ), "bmp_file", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( bitmap_file_entryfocusout ), NULL );
+       entry.connect( "focus_out_event", G_CALLBACK( bitmap_file_entryfocusout ), NULL );
 
-       hbox2 = gtk_hbox_new( TRUE, 5 );
+       hbox2 = ui::HBox( TRUE, 5 );
        gtk_widget_show( hbox2 );
        gtk_table_attach( GTK_TABLE( table ), hbox2, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( 0 ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 
-       button = gtk_button_new_with_label( "Browse..." );
+       button = ui::Button( "Browse..." );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
-       gtk_widget_set_usize( button, 60, -2 );
+       gtk_widget_set_size_request( button, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "bmp_file_browse", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_browse ), NULL );
+       button.connect( "clicked", G_CALLBACK( bitmap_browse ), NULL );
 
-       button = gtk_button_new_with_label( "Reload" );
+       button = ui::Button( "Reload" );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
-       gtk_widget_set_usize( button, 60, -2 );
+       gtk_widget_set_size_request( button, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "bmp_reload", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( bitmap_reload ), NULL );
+       button.connect( "clicked", G_CALLBACK( bitmap_reload ), NULL );
 
-       table = gtk_table_new( 2, 2, TRUE );
+       table = ui::Table( 2, 2, TRUE );
        gtk_widget_show( table );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "Map color 0 to:" );
+       label = ui::Label( "Map color 0 to:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
@@ -1857,7 +1857,7 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_RIGHT );
 
-       label = gtk_label_new( "Map color 255 to:" );
+       label = ui::Label( "Map color 255 to:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
@@ -1866,41 +1866,41 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        gtk_label_set_justify( GTK_LABEL( label ), GTK_JUSTIFY_RIGHT );
 
-       hbox2 = gtk_hbox_new( FALSE, 5 );
+       hbox2 = ui::HBox( FALSE, 5 );
        gtk_widget_show( hbox2 );
        gtk_table_attach( GTK_TABLE( table ), hbox2, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "bmp_black", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.black_value );
 
-       hbox2 = gtk_hbox_new( FALSE, 5 );
+       hbox2 = ui::HBox( FALSE, 5 );
        gtk_widget_show( hbox2 );
        gtk_table_attach( GTK_TABLE( table ), hbox2, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_box_pack_start( GTK_BOX( hbox2 ), entry, FALSE, FALSE, 0 );
-       gtk_widget_set_usize( entry, 50, -2 );
+       gtk_widget_set_size_request( entry, 50, -1 );
        g_object_set_data( G_OBJECT( dlg ), "bmp_white", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value );
+       entry.connect( "focus_out_event", G_CALLBACK( doublevariable_entryfocusout ), &gbmp.white_value );
 
-       vbox = gtk_vbox_new( FALSE, 10 );
+       vbox = ui::VBox( FALSE, 10 );
        gtk_widget_show( vbox );
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
-       label = gtk_label_new( "Fix Points" );
+       label = ui::Label( "Fix Points" );
        gtk_widget_show( label );
        gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), vbox, label );
 
-       label = gtk_label_new( "Click on a vertex in the lower half of the preview window,\n"
+       label = ui::Label( "Click on a vertex in the lower half of the preview window,\n"
                                                   "then use the arrow keys or text box to assign a value.\n"
                                                   "Use Ctrl+Click to select multiple vertices/toggle a\n"
                                                   "selection. Use Shift+Click to select a range of vertices.\n\n"
@@ -1909,14 +1909,14 @@ GtkWidget* create_main_dialog(){
        gtk_widget_show( label );
        gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
 
-       table = gtk_table_new( 3, 3, FALSE );
+       table = ui::Table( 3, 3, FALSE );
        gtk_widget_show( table );
        gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
        gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "Value:" );
+       label = ui::Label( "Value:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1924,7 +1924,7 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        g_object_set_data( G_OBJECT( dlg ), "fix_value_text", label );
 
-       label = gtk_label_new( "Range affected:" );
+       label = ui::Label( "Range affected:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1932,7 +1932,7 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        g_object_set_data( G_OBJECT( dlg ), "fix_range_text", label );
 
-       label = gtk_label_new( "Rate of change:" );
+       label = ui::Label( "Rate of change:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -1940,250 +1940,250 @@ GtkWidget* create_main_dialog(){
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
        g_object_set_data( G_OBJECT( dlg ), "fix_rate_text", label );
 
-       adj = gtk_adjustment_new( 0, -65536, 65536, 1, 16, 0 );
-       g_signal_connect( G_OBJECT( adj ), "value_changed", G_CALLBACK( fix_value_changed ), NULL );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       adj = ui::Adjustment( 0, -65536, 65536, 1, 16, 0 );
+       adj.connect( "value_changed", G_CALLBACK( fix_value_changed ), NULL );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND ),
                                          (GtkAttachOptions) ( GTK_EXPAND ), 0, 0 );
-       gtk_widget_set_usize( spin, 60, -2 );
+       gtk_widget_set_size_request( spin, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "fix_value", spin );
-       g_signal_connect( G_OBJECT( spin ), "focus_out_event", G_CALLBACK( fix_value_entryfocusout ), NULL );
+       spin.connect( "focus_out_event", G_CALLBACK( fix_value_entryfocusout ), NULL );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "fix_range", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( fix_range_entryfocusout ), NULL );
+       entry.connect( "focus_out_event", G_CALLBACK( fix_range_entryfocusout ), NULL );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "fix_rate", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( fix_rate_entryfocusout ), NULL );
+       entry.connect( "focus_out_event", G_CALLBACK( fix_rate_entryfocusout ), NULL );
 
-       button = gtk_button_new_with_label( "Free" );
+       button = ui::Button( "Free" );
        gtk_widget_show( button );
        gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( button, 60, -2 );
+       gtk_widget_set_size_request( button, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "fix_free", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_free ), NULL );
+       button.connect( "clicked", G_CALLBACK( fix_free ), NULL );
 
-       button = gtk_button_new_with_label( "Free All" );
+       button = ui::Button( "Free All" );
        gtk_widget_show( button );
        gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( button, 60, -2 );
+       gtk_widget_set_size_request( button, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "fix_freeall", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( fix_freeall ), NULL );
+       button.connect( "clicked", G_CALLBACK( fix_freeall ), NULL );
 
-       vbox = gtk_vbox_new( FALSE, 10 );
+       vbox = ui::VBox( FALSE, 10 );
        gtk_widget_show( vbox );
        gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
 
-       label = gtk_label_new( "Texture" );
+       label = ui::Label( "Texture" );
        gtk_widget_show( label );
        gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), vbox, label );
 
        // ^Fishman - Modified to add more labels and textboxes.
-       table = gtk_table_new( 5, 2, FALSE );
+       table = ui::Table( 5, 2, FALSE );
        gtk_widget_show( table );
        gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "Surface:" );
+       label = ui::Label( "Surface:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
 
-       label = gtk_label_new( "Other:" );
+       label = ui::Label( "Other:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
 
-       label = gtk_label_new( "Steep:" );
+       label = ui::Label( "Steep:" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
        gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "texture1", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 0 ) );
+       entry.connect( "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 0 ) );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "texture2", entry );
-       g_signal_connect( G_OBJECT( entry ), "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 1 ) );
+       entry.connect( "focus_out_event", G_CALLBACK( texture_entryfocusout ), GINT_TO_POINTER( 1 ) );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 2, 3,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "texture3", entry );
 
-       hbox2 = gtk_hbox_new( FALSE, 5 );
+       hbox2 = ui::HBox( FALSE, 5 );
        gtk_widget_show( hbox2 );
        gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 0 );
 
-       label = gtk_label_new( "\"Steep\" angle:" );
+       label = ui::Label( "\"Steep\" angle:" );
        gtk_widget_show( label );
        gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
 
-       adj = gtk_adjustment_new( 60, 0, 90, 1, 10, 0 );
-       spin = gtk_spin_button_new( GTK_ADJUSTMENT( adj ), 1, 0 );
+       adj = ui::Adjustment( 60, 0, 90, 1, 10, 0 );
+       spin = ui::SpinButton( adj, 1, 0 );
        gtk_widget_show( spin );
        gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "tex_slant", spin );
 
-       table = gtk_table_new( 2, 4, TRUE );
+       table = ui::Table( 2, 4, TRUE );
        gtk_widget_show( table );
        gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
        gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
        gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
 
-       label = gtk_label_new( "Offset <h,v>" );
+       label = ui::Label( "Offset <h,v>" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 2, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       label = gtk_label_new( "Scale <h,v>" );
+       label = ui::Label( "Scale <h,v>" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 2, 4, 0, 1,
                                          (GtkAttachOptions) ( GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "texoffsetx", entry );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "texoffsety", entry );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 2, 3, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "texscalex", entry );
 
-       entry = gtk_entry_new();
+       entry = ui::Entry();
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
                                          (GtkAttachOptions) ( GTK_FILL ), 0, 0 );
-       gtk_widget_set_usize( entry, 60, -2 );
+       gtk_widget_set_size_request( entry, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "texscaley", entry );
 
 
 
-       check = gtk_check_button_new_with_label( "Use detail brushes" );
+       check = ui::CheckButton( "Use detail brushes" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "detail", check );
-       g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_detail ), NULL );
+       check.connect( "toggled", G_CALLBACK( texture_detail ), NULL );
 
-       check = gtk_check_button_new_with_label( "Detail hint brushes" );
+       check = ui::CheckButton( "Detail hint brushes" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "hint", check );
-       g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_hint ), NULL );
+       check.connect( "toggled", G_CALLBACK( texture_hint ), NULL );
 
        // ^Fishman - Add terrain key to func_group.
-       check = gtk_check_button_new_with_label( "Add terrain key" );
+       check = ui::CheckButton( "Add terrain key" );
        gtk_widget_show( check );
        gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "terrain_ent", check );
-       g_signal_connect( G_OBJECT( check ), "toggled", G_CALLBACK( texture_terrainent ), NULL );
+       check.connect( "toggled", G_CALLBACK( texture_terrainent ), NULL );
 
-       vbox = gtk_vbox_new( FALSE, 5 );
+       vbox = ui::VBox( FALSE, 5 );
        gtk_widget_show( vbox );
        gtk_box_pack_start( GTK_BOX( hbox ), vbox, FALSE, TRUE, 0 );
 
-       button = gtk_button_new_with_label( "OK" );
+       button = ui::Button( "OK" );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
-       gtk_widget_set_usize( button, 60, -2 );
+       gtk_widget_set_size_request( button, 60, -1 );
        g_object_set_data( G_OBJECT( dlg ), "go", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_go ), NULL );
+       button.connect( "clicked", G_CALLBACK( main_go ), NULL );
 
-       label = gtk_label_new( "Settings:" );
+       label = ui::Label( "Settings:" );
        gtk_widget_show( label );
        gtk_box_pack_start( GTK_BOX( vbox ), label, FALSE, TRUE, 0 );
 
-       button = gtk_button_new_with_label( "Open..." );
+       button = ui::Button( "Open..." );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "open", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_open ), NULL );
+       button.connect( "clicked", G_CALLBACK( main_open ), NULL );
 
-       button = gtk_button_new_with_label( "Save as..." );
+       button = ui::Button( "Save as..." );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "save", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_save ), NULL );
+       button.connect( "clicked", G_CALLBACK( main_save ), NULL );
 
-       button = gtk_button_new_with_label( "Defaults" );
+       button = ui::Button( "Defaults" );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
        g_object_set_data( G_OBJECT( dlg ), "defaults", button );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_defaults ), NULL );
+       button.connect( "clicked", G_CALLBACK( main_defaults ), NULL );
 
-       button = gtk_button_new_with_label( "About..." );
+       button = ui::Button( "About..." );
        gtk_widget_show( button );
        gtk_box_pack_start( GTK_BOX( vbox ), button, FALSE, TRUE, 0 );
-       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( main_about ), NULL );