Version 1.3.11 Require GLib-1.3.11, Pango-0.22, ATK-0.7. Restore to

Thu Nov 22 15:01:03 2001  Owen Taylor  <otaylor@redhat.com>
        * Version 1.3.11
        * configure.in (ATK_REQUIRED_VERSION): Require
        GLib-1.3.11, Pango-0.22, ATK-0.7.
        * tests/prop-editor.c (property_widget): Restore
        to working as well as it did before.
        * gtk/gtklistitem.h: Mark deprecated since it is
        an integral part of GtkList.
        * demos/gtk-demo/demo-common.h: New header file,
        for a common functions not important to the meat
        of the demos.

        * demos/gtk-demo/main.c (demo_ifind_file): Add a utility
        function to search for a file used by the demo.
        * demos/*.c: Use demo_find_file.
This commit is contained in:
Owen Taylor 2001-11-23 21:46:44 +00:00 committed by Owen Taylor
parent 393c47573e
commit 2936c8e942
60 changed files with 32883 additions and 27219 deletions

View File

@ -1,3 +1,25 @@
Thu Nov 22 15:01:03 2001 Owen Taylor <otaylor@redhat.com>
* Version 1.3.11
* configure.in (ATK_REQUIRED_VERSION): Require
GLib-1.3.11, Pango-0.22, ATK-0.7.
* tests/prop-editor.c (property_widget): Restore
to working as well as it did before.
* gtk/gtklistitem.h: Mark deprecated since it is
an integral part of GtkList.
* demos/gtk-demo/demo-common.h: New header file,
for a common functions not important to the meat
of the demos.
* demos/gtk-demo/main.c (demo_ifind_file): Add a utility
function to search for a file used by the demo.
* demos/*.c: Use demo_find_file.
2001-11-23 Matthias Clasen <matthiasc@poet.de> 2001-11-23 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktextbuffer.c (gtk_text_buffer_create_tag), * gtk/gtktextbuffer.c (gtk_text_buffer_create_tag),

View File

@ -1,3 +1,25 @@
Thu Nov 22 15:01:03 2001 Owen Taylor <otaylor@redhat.com>
* Version 1.3.11
* configure.in (ATK_REQUIRED_VERSION): Require
GLib-1.3.11, Pango-0.22, ATK-0.7.
* tests/prop-editor.c (property_widget): Restore
to working as well as it did before.
* gtk/gtklistitem.h: Mark deprecated since it is
an integral part of GtkList.
* demos/gtk-demo/demo-common.h: New header file,
for a common functions not important to the meat
of the demos.
* demos/gtk-demo/main.c (demo_ifind_file): Add a utility
function to search for a file used by the demo.
* demos/*.c: Use demo_find_file.
2001-11-23 Matthias Clasen <matthiasc@poet.de> 2001-11-23 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktextbuffer.c (gtk_text_buffer_create_tag), * gtk/gtktextbuffer.c (gtk_text_buffer_create_tag),

View File

@ -1,3 +1,25 @@
Thu Nov 22 15:01:03 2001 Owen Taylor <otaylor@redhat.com>
* Version 1.3.11
* configure.in (ATK_REQUIRED_VERSION): Require
GLib-1.3.11, Pango-0.22, ATK-0.7.
* tests/prop-editor.c (property_widget): Restore
to working as well as it did before.
* gtk/gtklistitem.h: Mark deprecated since it is
an integral part of GtkList.
* demos/gtk-demo/demo-common.h: New header file,
for a common functions not important to the meat
of the demos.
* demos/gtk-demo/main.c (demo_ifind_file): Add a utility
function to search for a file used by the demo.
* demos/*.c: Use demo_find_file.
2001-11-23 Matthias Clasen <matthiasc@poet.de> 2001-11-23 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktextbuffer.c (gtk_text_buffer_create_tag), * gtk/gtktextbuffer.c (gtk_text_buffer_create_tag),

View File

@ -1,3 +1,25 @@
Thu Nov 22 15:01:03 2001 Owen Taylor <otaylor@redhat.com>
* Version 1.3.11
* configure.in (ATK_REQUIRED_VERSION): Require
GLib-1.3.11, Pango-0.22, ATK-0.7.
* tests/prop-editor.c (property_widget): Restore
to working as well as it did before.
* gtk/gtklistitem.h: Mark deprecated since it is
an integral part of GtkList.
* demos/gtk-demo/demo-common.h: New header file,
for a common functions not important to the meat
of the demos.
* demos/gtk-demo/main.c (demo_ifind_file): Add a utility
function to search for a file used by the demo.
* demos/*.c: Use demo_find_file.
2001-11-23 Matthias Clasen <matthiasc@poet.de> 2001-11-23 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktextbuffer.c (gtk_text_buffer_create_tag), * gtk/gtktextbuffer.c (gtk_text_buffer_create_tag),

View File

@ -1,3 +1,25 @@
Thu Nov 22 15:01:03 2001 Owen Taylor <otaylor@redhat.com>
* Version 1.3.11
* configure.in (ATK_REQUIRED_VERSION): Require
GLib-1.3.11, Pango-0.22, ATK-0.7.
* tests/prop-editor.c (property_widget): Restore
to working as well as it did before.
* gtk/gtklistitem.h: Mark deprecated since it is
an integral part of GtkList.
* demos/gtk-demo/demo-common.h: New header file,
for a common functions not important to the meat
of the demos.
* demos/gtk-demo/main.c (demo_ifind_file): Add a utility
function to search for a file used by the demo.
* demos/*.c: Use demo_find_file.
2001-11-23 Matthias Clasen <matthiasc@poet.de> 2001-11-23 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktextbuffer.c (gtk_text_buffer_create_tag), * gtk/gtktextbuffer.c (gtk_text_buffer_create_tag),

View File

@ -1,3 +1,25 @@
Thu Nov 22 15:01:03 2001 Owen Taylor <otaylor@redhat.com>
* Version 1.3.11
* configure.in (ATK_REQUIRED_VERSION): Require
GLib-1.3.11, Pango-0.22, ATK-0.7.
* tests/prop-editor.c (property_widget): Restore
to working as well as it did before.
* gtk/gtklistitem.h: Mark deprecated since it is
an integral part of GtkList.
* demos/gtk-demo/demo-common.h: New header file,
for a common functions not important to the meat
of the demos.
* demos/gtk-demo/main.c (demo_ifind_file): Add a utility
function to search for a file used by the demo.
* demos/*.c: Use demo_find_file.
2001-11-23 Matthias Clasen <matthiasc@poet.de> 2001-11-23 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktextbuffer.c (gtk_text_buffer_create_tag), * gtk/gtktextbuffer.c (gtk_text_buffer_create_tag),

View File

@ -1,3 +1,25 @@
Thu Nov 22 15:01:03 2001 Owen Taylor <otaylor@redhat.com>
* Version 1.3.11
* configure.in (ATK_REQUIRED_VERSION): Require
GLib-1.3.11, Pango-0.22, ATK-0.7.
* tests/prop-editor.c (property_widget): Restore
to working as well as it did before.
* gtk/gtklistitem.h: Mark deprecated since it is
an integral part of GtkList.
* demos/gtk-demo/demo-common.h: New header file,
for a common functions not important to the meat
of the demos.
* demos/gtk-demo/main.c (demo_ifind_file): Add a utility
function to search for a file used by the demo.
* demos/*.c: Use demo_find_file.
2001-11-23 Matthias Clasen <matthiasc@poet.de> 2001-11-23 Matthias Clasen <matthiasc@poet.de>
* gtk/gtktextbuffer.c (gtk_text_buffer_create_tag), * gtk/gtktextbuffer.c (gtk_text_buffer_create_tag),

View File

@ -80,9 +80,9 @@ AC_SUBST(GDK_PIXBUF_MICRO)
AC_SUBST(GDK_PIXBUF_VERSION) AC_SUBST(GDK_PIXBUF_VERSION)
## Versions of dependencies ## Versions of dependencies
GLIB_REQUIRED_VERSION=1.3.10 GLIB_REQUIRED_VERSION=1.3.11
PANGO_REQUIRED_VERSION=0.20 PANGO_REQUIRED_VERSION=0.22
ATK_REQUIRED_VERSION=0.5 ATK_REQUIRED_VERSION=0.7
# For automake. # For automake.
VERSION=$GTK_VERSION VERSION=$GTK_VERSION

View File

@ -58,6 +58,7 @@ demos.h: $(demos) geninclude.pl
gtk_demo_SOURCES = \ gtk_demo_SOURCES = \
$(demos) \ $(demos) \
demo-common.h \
main.c \ main.c \
demos.h demos.h

View File

@ -4,6 +4,7 @@
*/ */
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "demo-common.h"
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
@ -95,6 +96,7 @@ register_stock_icons (void)
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GtkIconFactory *factory; GtkIconFactory *factory;
char *filename;
static GtkStockItem items[] = { static GtkStockItem items[] = {
{ "demo-gtk-logo", { "demo-gtk-logo",
@ -111,12 +113,17 @@ register_stock_icons (void)
factory = gtk_icon_factory_new (); factory = gtk_icon_factory_new ();
gtk_icon_factory_add_default (factory); gtk_icon_factory_add_default (factory);
/* Try current directory */ /* demo_find_file() looks in the the current directory first,
pixbuf = gdk_pixbuf_new_from_file ("./gtk-logo-rgb.gif", NULL); * so you can run gtk-demo without installing GTK, then looks
* in the location where the file is installed.
/* Try install directory */ */
if (pixbuf == NULL) pixbuf = NULL;
pixbuf = gdk_pixbuf_new_from_file (DEMOCODEDIR"/gtk-logo-rgb.gif", NULL); filename = demo_find_file ("gtk-logo-rgb.gif", NULL);
if (filename)
{
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
g_free (filename);
}
/* Register icon to accompany stock item */ /* Register icon to accompany stock item */
if (pixbuf != NULL) if (pixbuf != NULL)

View File

@ -0,0 +1,11 @@
#ifndef __DEMO_COMMON_H__
#define __DEMO_COMMON_H__
G_BEGIN_DECLS
gchar *demo_find_file (const gchar *base,
GError **err);
G_END_DECLS
#endif /* __DEMO_COMMON_H__ */

View File

@ -15,6 +15,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include "demo-common.h"
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
static GdkPixbufLoader *pixbuf_loader = NULL; static GdkPixbufLoader *pixbuf_loader = NULL;
@ -177,14 +178,29 @@ progressive_timeout (gpointer data)
} }
else else
{ {
const gchar *filename; gchar *filename;
gchar *error_message = NULL;
GError *error = NULL;
if (g_file_test ("./alphatest.png", G_FILE_TEST_EXISTS)) /* demo_find_file() looks in the the current directory first,
filename = "./alphatest.png"; * so you can run gtk-demo without installing GTK, then looks
* in the location where the file is installed.
*/
filename = demo_find_file ("alphatest.png", &error);
if (error)
{
error_message = g_strdup (error->message);
g_error_free (error);
}
else else
filename = DEMOCODEDIR"/alphatest.png"; {
image_stream = fopen (filename, "r");
image_stream = fopen (filename, "r"); g_free (filename);
if (!image_stream)
error_message = g_strdup_printf ("Unable to open image file 'alphatest.png': %s",
g_strerror (errno));
}
if (image_stream == NULL) if (image_stream == NULL)
{ {
@ -194,8 +210,8 @@ progressive_timeout (gpointer data)
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE, GTK_BUTTONS_CLOSE,
"Unable to open image file 'alphatest.png': %s", "%s", error_message);
g_strerror (errno)); g_free (error_message);
g_signal_connect (dialog, "response", g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL); G_CALLBACK (gtk_widget_destroy), NULL);
@ -272,6 +288,9 @@ do_images (void)
GtkWidget *image; GtkWidget *image;
GtkWidget *label; GtkWidget *label;
GtkWidget *align; GtkWidget *align;
GdkPixbuf *pixbuf;
GError *error = NULL;
char *filename;
if (!window) if (!window)
{ {
@ -303,10 +322,19 @@ do_images (void)
gtk_container_add (GTK_CONTAINER (align), frame); gtk_container_add (GTK_CONTAINER (align), frame);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
/* We look for the image in the current directory first, /* demo_find_file() looks in the the current directory first,
* so you can run gtk-demo without installing GTK * so you can run gtk-demo without installing GTK, then looks
* in the location where the file is installed.
*/ */
if (g_file_test ("./gtk-logo-rgb.gif", G_FILE_TEST_EXISTS)) pixbuf = NULL;
filename = demo_find_file ("gtk-logo-rgb.gif", &error);
if (filename)
{
pixbuf = gdk_pixbuf_new_from_file (filename, &error);
g_free (filename);
}
if (error)
{ {
/* This code shows off error handling. You can just use /* This code shows off error handling. You can just use
* gtk_image_new_from_file() instead if you don't want to report * gtk_image_new_from_file() instead if you don't want to report
@ -314,39 +342,23 @@ do_images (void)
* gtk_image_new_from_file(), a "missing image" icon will * gtk_image_new_from_file(), a "missing image" icon will
* be displayed instead. * be displayed instead.
*/ */
GdkPixbuf *pixbuf; GtkWidget *dialog;
GError *error = NULL;
pixbuf = gdk_pixbuf_new_from_file ("./gtk-logo-rgb.gif", dialog = gtk_message_dialog_new (GTK_WINDOW (window),
&error); GTK_DIALOG_DESTROY_WITH_PARENT,
if (error) GTK_MESSAGE_ERROR,
{ GTK_BUTTONS_CLOSE,
GtkWidget *dialog; "Unable to open image file 'gtk-logo-rgb.gif': %s",
error->message);
dialog = gtk_message_dialog_new (GTK_WINDOW (window), g_error_free (error);
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Unable to open image file 'gtk-logo-rgb.gif': %s",
error->message);
g_error_free (error);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_widget_show (dialog);
}
image = gtk_image_new_from_pixbuf (pixbuf); g_signal_connect (dialog, "response",
} G_CALLBACK (gtk_widget_destroy), NULL);
else
{ gtk_widget_show (dialog);
/* This is the simpler code, with no error handling.
* Here we're loading the installed gtk-logo-rgb.gif instead
* of the one in the current directory.
*/
image = gtk_image_new_from_file (DEMOCODEDIR"/gtk-logo-rgb.gif");
} }
image = gtk_image_new_from_pixbuf (pixbuf);
gtk_container_add (GTK_CONTAINER (frame), image); gtk_container_add (GTK_CONTAINER (frame), image);
@ -367,13 +379,9 @@ do_images (void)
gtk_container_add (GTK_CONTAINER (align), frame); gtk_container_add (GTK_CONTAINER (align), frame);
gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), align, FALSE, FALSE, 0);
/* We look for the image in the current directory first, filename = demo_find_file ("floppybuddy.gif", NULL);
* so you can run gtk-demo without installing GTK image = gtk_image_new_from_file (filename);
*/ g_free (filename);
if (g_file_test ("./floppybuddy.gif", G_FILE_TEST_EXISTS))
image = gtk_image_new_from_file ("./floppybuddy.gif");
else
image = gtk_image_new_from_file (DEMOCODEDIR"/floppybuddy.gif");
gtk_container_add (GTK_CONTAINER (frame), image); gtk_container_add (GTK_CONTAINER (frame), image);

View File

@ -13,6 +13,7 @@ static GtkTextBuffer *source_buffer;
static gchar *current_file = NULL; static gchar *current_file = NULL;
enum { enum {
TITLE_COLUMN, TITLE_COLUMN,
FILENAME_COLUMN, FILENAME_COLUMN,
@ -28,6 +29,39 @@ struct _CallbackData
GtkTreePath *path; GtkTreePath *path;
}; };
/**
* demo_find_file:
* @base: base filename
* @err: location to store error, or %NULL.
*
* Looks for @base first in the current directory, then in the
* location GTK+ where it will be installed on make install,
* returns the first file found.
*
* Return value: the filename, if found or %NULL
**/
gchar *
demo_find_file (const char *base,
GError **err)
{
g_return_val_if_fail (err == NULL || *err == NULL, FALSE);
if (g_file_test (base, G_FILE_TEST_EXISTS))
return g_strdup (base);
else
{
char *filename = g_build_filename (DEMOCODEDIR, base, NULL);
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
{
g_set_error (err, G_FILE_ERROR, G_FILE_ERROR_NOENT,
"Cannot find demo data file \"%s\"", base);
g_free (filename);
return NULL;
}
return filename;
}
}
static void static void
window_closed_cb (GtkWidget *window, gpointer data) window_closed_cb (GtkWidget *window, gpointer data)
{ {
@ -364,6 +398,8 @@ load_file (const gchar *filename)
{ {
FILE *file; FILE *file;
GtkTextIter start, end; GtkTextIter start, end;
char *full_filename;
GError *err = NULL;
GString *buffer = g_string_new (NULL); GString *buffer = g_string_new (NULL);
int state = 0; int state = 0;
gboolean in_para = 0; gboolean in_para = 0;
@ -383,26 +419,24 @@ load_file (const gchar *filename)
gtk_text_buffer_get_bounds (source_buffer, &start, &end); gtk_text_buffer_get_bounds (source_buffer, &start, &end);
gtk_text_buffer_delete (source_buffer, &start, &end); gtk_text_buffer_delete (source_buffer, &start, &end);
file = fopen (filename, "r"); full_filename = demo_find_file (filename, &err);
if (!full_filename)
if (!file)
{ {
char *installed = g_strconcat (DEMOCODEDIR, g_warning ("%s", err->message);
G_DIR_SEPARATOR_S, g_error_free (err);
filename,
NULL);
file = fopen (installed, "r");
g_free (installed);
}
if (!file)
{
g_warning ("Cannot open %s: %s\n", filename, g_strerror (errno));
return; return;
} }
file = fopen (full_filename, "r");
if (!file)
g_warning ("Cannot open %s: %s\n", full_filename, g_strerror (errno));
g_free (full_filename);
if (!file)
return;
gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0); gtk_text_buffer_get_iter_at_offset (info_buffer, &start, 0);
while (read_line (file, buffer)) while (read_line (file, buffer))
{ {
@ -701,38 +735,36 @@ static void
setup_default_icon (void) setup_default_icon (void)
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
char *filename;
/* Try in current directory, in case we haven't yet been installed GError *err;
* (would be wrong in a real app)
*/
pixbuf = gdk_pixbuf_new_from_file ("./gtk-logo-rgb.gif", NULL);
if (pixbuf == NULL) err = NULL;
pixbuf = NULL;
filename = demo_find_file ("gtk-logo-rgb.gif", &err);
if (filename)
{ {
GError *err; pixbuf = gdk_pixbuf_new_from_file (filename, &err);
g_free (filename);
}
err = NULL; /* Ignoring this error (passing NULL instead of &err above)
pixbuf = gdk_pixbuf_new_from_file (DEMOCODEDIR"/gtk-logo-rgb.gif", * would probably be reasonable for most apps. We're just
&err); * showing off.
*/
if (err)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Failed to read icon file: %s",
err->message);
g_error_free (err);
/* Ignoring this error (passing NULL instead of &err above) g_signal_connect (dialog, "response",
* would probably be reasonable for most apps. We're just G_CALLBACK (gtk_widget_destroy), NULL);
* showing off.
*/
if (err)
{
GtkWidget *dialog;
dialog = gtk_message_dialog_new (NULL, 0,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"Failed to read icon file "DEMOCODEDIR"/gtk-logo-rgb.gif: %s",
err->message);
g_error_free (err);
g_signal_connect (dialog, "response",
G_CALLBACK (gtk_widget_destroy), NULL);
}
} }
if (pixbuf) if (pixbuf)

View File

@ -17,12 +17,13 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <math.h> #include <math.h>
#include "demo-common.h"
#define FRAME_DELAY 50 #define FRAME_DELAY 50
#define RELATIVE_BACKGROUND_NAME "background.jpg" #define BACKGROUND_NAME "background.jpg"
#define INSTALLED_BACKGROUND_NAME DEMOCODEDIR"/background.jpg"
static const char *relative_image_names[] = { static const char *image_names[] = {
"apple-red.png", "apple-red.png",
"gnome-applets.png", "gnome-applets.png",
"gnome-calendar.png", "gnome-calendar.png",
@ -33,18 +34,7 @@ static const char *relative_image_names[] = {
"gnu-keys.png" "gnu-keys.png"
}; };
static const char *installed_image_names[] = { #define N_IMAGES G_N_ELEMENTS (image_names)
DEMOCODEDIR"/apple-red.png",
DEMOCODEDIR"/gnome-applets.png",
DEMOCODEDIR"/gnome-calendar.png",
DEMOCODEDIR"/gnome-foot.png",
DEMOCODEDIR"/gnome-gmush.png",
DEMOCODEDIR"/gnome-gimp.png",
DEMOCODEDIR"/gnome-gsame.png",
DEMOCODEDIR"/gnu-keys.png"
};
#define N_IMAGES G_N_ELEMENTS (relative_image_names)
/* demo window */ /* demo window */
static GtkWidget *window = NULL; static GtkWidget *window = NULL;
@ -67,30 +57,37 @@ static gboolean
load_pixbufs (GError **error) load_pixbufs (GError **error)
{ {
gint i; gint i;
const gchar **image_names; char *filename;
if (background) if (background)
return TRUE; /* already loaded earlier */ return TRUE; /* already loaded earlier */
background = gdk_pixbuf_new_from_file (RELATIVE_BACKGROUND_NAME, NULL); /* demo_find_file() looks in the the current directory first,
* so you can run gtk-demo without installing GTK, then looks
if (!background) * in the location where the file is installed.
background = gdk_pixbuf_new_from_file (INSTALLED_BACKGROUND_NAME, error); */
filename = demo_find_file (BACKGROUND_NAME, error);
if (!background) if (!filename)
return FALSE; /* note that "error" was filled in and returned */ return FALSE; /* note that "error" was filled in and returned */
background = gdk_pixbuf_new_from_file (filename, error);
g_free (filename);
if (!background)
return FALSE; /* Note that "error" was filled with a GError */
back_width = gdk_pixbuf_get_width (background); back_width = gdk_pixbuf_get_width (background);
back_height = gdk_pixbuf_get_height (background); back_height = gdk_pixbuf_get_height (background);
if (g_file_test (relative_image_names[0], G_FILE_TEST_EXISTS))
image_names = relative_image_names;
else
image_names = installed_image_names;
for (i = 0; i < N_IMAGES; i++) for (i = 0; i < N_IMAGES; i++)
{ {
images[i] = gdk_pixbuf_new_from_file (image_names[i], error); filename = demo_find_file (image_names[i], error);
if (!filename)
return FALSE; /* Note that "error" was filled with a GError */
images[i] = gdk_pixbuf_new_from_file (filename, error);
g_free (filename);
if (!images[i]) if (!images[i])
return FALSE; /* Note that "error" was filled with a GError */ return FALSE; /* Note that "error" was filled with a GError */
} }

View File

@ -10,6 +10,8 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> /* for exit() */ #include <stdlib.h> /* for exit() */
#include "demo-common.h"
static void easter_egg_callback (GtkWidget *button, gpointer data); static void easter_egg_callback (GtkWidget *button, gpointer data);
#define gray50_width 2 #define gray50_width 2
@ -151,10 +153,19 @@ insert_text (GtkTextBuffer *buffer)
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GdkPixbuf *scaled; GdkPixbuf *scaled;
GtkTextChildAnchor *anchor; GtkTextChildAnchor *anchor;
char *filename;
pixbuf = gdk_pixbuf_new_from_file ("./gtk-logo-rgb.gif", NULL); /* demo_find_file() looks in the the current directory first,
if (pixbuf == NULL) * so you can run gtk-demo without installing GTK, then looks
gdk_pixbuf_new_from_file (DEMOCODEDIR"/gtk-logo-rgb.gif", NULL); * in the location where the file is installed.
*/
pixbuf = NULL;
filename = demo_find_file ("gtk-logo-rgb.gif", NULL);
if (filename)
{
pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
g_free (filename);
}
if (pixbuf == NULL) if (pixbuf == NULL)
{ {
@ -412,10 +423,9 @@ attach_widgets (GtkTextView *text_view)
} }
else if (i == 3) else if (i == 3)
{ {
if (g_file_test ("./floppybuddy.gif", G_FILE_TEST_EXISTS)) gchar *filename = demo_find_file ("floppybuddy.gif", NULL);
widget = gtk_image_new_from_file ("./floppybuddy.gif"); widget = gtk_image_new_from_file (filename);
else g_free (filename);
widget = gtk_image_new_from_file (DEMOCODEDIR"/floppybuddy.gif");
} }
else if (i == 4) else if (i == 4)
{ {

View File

@ -24,6 +24,8 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#ifndef GTK_DISABLE_DEPRECATED
#ifndef __GTK_LIST_ITEM_H__ #ifndef __GTK_LIST_ITEM_H__
#define __GTK_LIST_ITEM_H__ #define __GTK_LIST_ITEM_H__
@ -92,3 +94,5 @@ void gtk_list_item_deselect (GtkListItem *list_item);
#endif /* __GTK_LIST_ITEM_H__ */ #endif /* __GTK_LIST_ITEM_H__ */
#endif /* GTK_DISABLE_DEPRECATED */

1376
po/az.po

File diff suppressed because it is too large Load Diff

1457
po/ca.po

File diff suppressed because it is too large Load Diff

1457
po/cs.po

File diff suppressed because it is too large Load Diff

1377
po/da.po

File diff suppressed because it is too large Load Diff

1375
po/de.po

File diff suppressed because it is too large Load Diff

1546
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1412
po/es.po

File diff suppressed because it is too large Load Diff

1457
po/et.po

File diff suppressed because it is too large Load Diff

1457
po/eu.po

File diff suppressed because it is too large Load Diff

1439
po/fa.po

File diff suppressed because it is too large Load Diff

1415
po/fi.po

File diff suppressed because it is too large Load Diff

1428
po/fr.po

File diff suppressed because it is too large Load Diff

1439
po/ga.po

File diff suppressed because it is too large Load Diff

1446
po/gl.po

File diff suppressed because it is too large Load Diff

1416
po/he.po

File diff suppressed because it is too large Load Diff

1457
po/hr.po

File diff suppressed because it is too large Load Diff

1415
po/hu.po

File diff suppressed because it is too large Load Diff

1415
po/ia.po

File diff suppressed because it is too large Load Diff

1415
po/it.po

File diff suppressed because it is too large Load Diff

1372
po/ja.po

File diff suppressed because it is too large Load Diff

1457
po/ko.po

File diff suppressed because it is too large Load Diff

1457
po/lt.po

File diff suppressed because it is too large Load Diff

1446
po/nl.po

File diff suppressed because it is too large Load Diff

1447
po/nn.po

File diff suppressed because it is too large Load Diff

1182
po/no.po

File diff suppressed because it is too large Load Diff

1439
po/pl.po

File diff suppressed because it is too large Load Diff

1457
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1447
po/ro.po

File diff suppressed because it is too large Load Diff

1372
po/ru.po

File diff suppressed because it is too large Load Diff

1300
po/sk.po

File diff suppressed because it is too large Load Diff

1455
po/sl.po

File diff suppressed because it is too large Load Diff

1436
po/sp.po

File diff suppressed because it is too large Load Diff

1436
po/sr.po

File diff suppressed because it is too large Load Diff

1380
po/sv.po

File diff suppressed because it is too large Load Diff

1227
po/tr.po

File diff suppressed because it is too large Load Diff

1401
po/uk.po

File diff suppressed because it is too large Load Diff

1455
po/vi.po

File diff suppressed because it is too large Load Diff

1390
po/wa.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gtk+ 1.3.11\n" "Project-Id-Version: gtk+ 1.3.11\n"
"POT-Creation-Date: 2001-11-19 16:18-0500\n" "POT-Creation-Date: 2001-11-23 15:47-0500\n"
"PO-Revision-Date: 2001-11-20 07:13+0800\n" "PO-Revision-Date: 2001-11-20 07:13+0800\n"
"Last-Translator: Abel Cheung <maddog@linux.org.hk>\n" "Last-Translator: Abel Cheung <maddog@linux.org.hk>\n"
"Language-Team: traditional Chinese <zh-l10n@linux.org.tw>\n" "Language-Team: traditional Chinese <zh-l10n@linux.org.tw>\n"
@ -1942,7 +1942,7 @@ msgstr ""
msgid "The GtkAdjustment for the vertical position." msgid "The GtkAdjustment for the vertical position."
msgstr "" msgstr ""
#: gtk/gtklayout.c:612 gtk/gtktreeviewcolumn.c:180 #: gtk/gtklayout.c:612 gtk/gtktreeviewcolumn.c:189
msgid "Width" msgid "Width"
msgstr "寬度" msgstr "寬度"
@ -2115,7 +2115,7 @@ msgstr ""
msgid "Whether tabs should have homogeneous sizes" msgid "Whether tabs should have homogeneous sizes"
msgstr "標籤的尺寸應否統一" msgstr "標籤的尺寸應否統一"
#: gtk/gtknotebook.c:2238 gtk/gtknotebook.c:4474 #: gtk/gtknotebook.c:2240 gtk/gtknotebook.c:4470
#, c-format #, c-format
msgid "Page %u" msgid "Page %u"
msgstr "第 %u 頁" msgstr "第 %u 頁"
@ -2161,17 +2161,17 @@ msgstr ""
msgid "Width of handle" msgid "Width of handle"
msgstr "" msgstr ""
#: gtk/gtkrc.c:2721 #: gtk/gtkrc.c:2723
#, c-format #, c-format
msgid "Unable to locate image file in pixmap_path: \"%s\" line %d" msgid "Unable to locate image file in pixmap_path: \"%s\" line %d"
msgstr "無法在 pixmap_path 找到圖像檔:\"%s\" 第 %d 行" msgstr "無法在 pixmap_path 找到圖像檔:\"%s\" 第 %d 行"
#: gtk/gtkrc.c:2724 #: gtk/gtkrc.c:2726
#, c-format #, c-format
msgid "Unable to locate image file in pixmap_path: \"%s\"" msgid "Unable to locate image file in pixmap_path: \"%s\""
msgstr "無法在 pixmap_path 找到圖像檔:\"%s\"" msgstr "無法在 pixmap_path 找到圖像檔:\"%s\""
#: gtk/gtkrc.c:3133 #: gtk/gtkrc.c:3135
#, c-format #, c-format
msgid "Pixmap path element: \"%s\" must be absolute, %s, line %d" msgid "Pixmap path element: \"%s\" must be absolute, %s, line %d"
msgstr "Pixmap 路徑元素:「%s」必須為絕對路徑%s第 %d 行" msgstr "Pixmap 路徑元素:「%s」必須為絕對路徑%s第 %d 行"
@ -2847,7 +2847,7 @@ msgid "_Yes"
msgstr "是(_Y)" msgstr "是(_Y)"
#: gtk/gtkstock.c:334 #: gtk/gtkstock.c:334
#, no-c-format #, c-format
msgid "Zoom _100%" msgid "Zoom _100%"
msgstr "縮放 _100%" msgstr "縮放 _100%"
@ -3304,7 +3304,7 @@ msgstr ""
msgid "Vertical Adjustment for the widget" msgid "Vertical Adjustment for the widget"
msgstr "" msgstr ""
#: gtk/gtktreeview.c:521 gtk/gtktreeviewcolumn.c:172 gtk/gtkwidget.c:427 #: gtk/gtktreeview.c:521 gtk/gtktreeviewcolumn.c:173 gtk/gtkwidget.c:427
msgid "Visible" msgid "Visible"
msgstr "可見" msgstr "可見"
@ -3328,7 +3328,7 @@ msgstr ""
msgid "Set the column for the expander column" msgid "Set the column for the expander column"
msgstr "" msgstr ""
#: gtk/gtktreeview.c:545 gtk/gtktreeviewcolumn.c:263 #: gtk/gtktreeview.c:545 gtk/gtktreeviewcolumn.c:272
msgid "Reorderable" msgid "Reorderable"
msgstr "可重新排列" msgstr "可重新排列"
@ -3400,95 +3400,103 @@ msgstr ""
msgid "Make the expanders indented." msgid "Make the expanders indented."
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:173 #: gtk/gtktreeviewcolumn.c:174
msgid "Whether to display the column" msgid "Whether to display the column"
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:181 #: gtk/gtktreeviewcolumn.c:181 gtk/gtkwindow.c:394
msgid "Current width of the column" msgid "Resizable"
msgstr "目前的欄寬" msgstr "可重定尺寸"
#: gtk/gtktreeviewcolumn.c:189 #: gtk/gtktreeviewcolumn.c:182
msgid "Sizing" msgid "Column is user-resizable"
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:190 #: gtk/gtktreeviewcolumn.c:190
msgid "Current width of the column"
msgstr "目前的欄寬"
#: gtk/gtktreeviewcolumn.c:198
msgid "Sizing"
msgstr ""
#: gtk/gtktreeviewcolumn.c:199
msgid "Resize mode of the column" msgid "Resize mode of the column"
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:198 #: gtk/gtktreeviewcolumn.c:207
msgid "Fixed Width" msgid "Fixed Width"
msgstr "固定寬度" msgstr "固定寬度"
#: gtk/gtktreeviewcolumn.c:199 #: gtk/gtktreeviewcolumn.c:208
msgid "Current fixed width of the column" msgid "Current fixed width of the column"
msgstr "目前的固定欄寬" msgstr "目前的固定欄寬"
#: gtk/gtktreeviewcolumn.c:208 #: gtk/gtktreeviewcolumn.c:217
msgid "Minimum Width" msgid "Minimum Width"
msgstr "最小寬度" msgstr "最小寬度"
#: gtk/gtktreeviewcolumn.c:209 #: gtk/gtktreeviewcolumn.c:218
msgid "Minimum allowed width of the column" msgid "Minimum allowed width of the column"
msgstr "可接受的最小欄寬" msgstr "可接受的最小欄寬"
#: gtk/gtktreeviewcolumn.c:218 #: gtk/gtktreeviewcolumn.c:227
msgid "Maximum Width" msgid "Maximum Width"
msgstr "最大寬度" msgstr "最大寬度"
#: gtk/gtktreeviewcolumn.c:219 #: gtk/gtktreeviewcolumn.c:228
msgid "Maximum allowed width of the column" msgid "Maximum allowed width of the column"
msgstr "可接受的最大欄寬" msgstr "可接受的最大欄寬"
#: gtk/gtktreeviewcolumn.c:228 #: gtk/gtktreeviewcolumn.c:237
msgid "Title" msgid "Title"
msgstr "標題" msgstr "標題"
#: gtk/gtktreeviewcolumn.c:229 #: gtk/gtktreeviewcolumn.c:238
msgid "Title to appear in column header" msgid "Title to appear in column header"
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:236 #: gtk/gtktreeviewcolumn.c:245
msgid "Clickable" msgid "Clickable"
msgstr "可按下" msgstr "可按下"
#: gtk/gtktreeviewcolumn.c:237 #: gtk/gtktreeviewcolumn.c:246
msgid "Whether the header can be clicked" msgid "Whether the header can be clicked"
msgstr "可否按下標頭" msgstr "可否按下標頭"
#: gtk/gtktreeviewcolumn.c:245 #: gtk/gtktreeviewcolumn.c:254
msgid "Widget" msgid "Widget"
msgstr "視窗元件" msgstr "視窗元件"
#: gtk/gtktreeviewcolumn.c:246 #: gtk/gtktreeviewcolumn.c:255
msgid "Widget to put in column header button instead of column title" msgid "Widget to put in column header button instead of column title"
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:253 #: gtk/gtktreeviewcolumn.c:262
msgid "Alignment" msgid "Alignment"
msgstr "排列" msgstr "排列"
#: gtk/gtktreeviewcolumn.c:254 #: gtk/gtktreeviewcolumn.c:263
msgid "X Alignment of the column header text or widget" msgid "X Alignment of the column header text or widget"
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:264 #: gtk/gtktreeviewcolumn.c:273
msgid "Whether the column can be reordered around the headers" msgid "Whether the column can be reordered around the headers"
msgstr "" msgstr ""
#: gtk/gtktreeviewcolumn.c:271 #: gtk/gtktreeviewcolumn.c:280
msgid "Sort indicator" msgid "Sort indicator"
msgstr "排序指示器" msgstr "排序指示器"
#: gtk/gtktreeviewcolumn.c:272 #: gtk/gtktreeviewcolumn.c:281
msgid "Whether to show a sort indicator" msgid "Whether to show a sort indicator"
msgstr "是否顯示排序指示器" msgstr "是否顯示排序指示器"
#: gtk/gtktreeviewcolumn.c:279 #: gtk/gtktreeviewcolumn.c:288
msgid "Sort order" msgid "Sort order"
msgstr "排列次序" msgstr "排列次序"
#: gtk/gtktreeviewcolumn.c:280 #: gtk/gtktreeviewcolumn.c:289
msgid "Sort direction the sort indicator should indicate" msgid "Sort direction the sort indicator should indicate"
msgstr "排序指示器應顯示的排序方向" msgstr "排序指示器應顯示的排序方向"
@ -3681,10 +3689,6 @@ msgstr "可擴大"
msgid "If TRUE, users can expand the window beyond its minimum size." msgid "If TRUE, users can expand the window beyond its minimum size."
msgstr "若設為 TRUE使用者可以將視窗擴大至超過最小尺寸。" msgstr "若設為 TRUE使用者可以將視窗擴大至超過最小尺寸。"
#: gtk/gtkwindow.c:394
msgid "Resizable"
msgstr "可重定尺寸"
#: gtk/gtkwindow.c:395 #: gtk/gtkwindow.c:395
msgid "If TRUE, users can resize the window." msgid "If TRUE, users can resize the window."
msgstr "若設為 TRUE使用者可以重定視窗的尺寸。" msgstr "若設為 TRUE使用者可以重定視窗的尺寸。"

View File

@ -456,11 +456,10 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
GtkWidget *prop_edit; GtkWidget *prop_edit;
GtkAdjustment *adj; GtkAdjustment *adj;
gchar *msg; gchar *msg;
GType type = G_PARAM_SPEC_TYPE (spec);
#if 0
switch (G_PARAM_SPEC_TYPE (spec)) if (type == G_TYPE_PARAM_INT)
{ {
case G_TYPE_PARAM_INT:
adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_INT (spec)->default_value, adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_INT (spec)->default_value,
G_PARAM_SPEC_INT (spec)->minimum, G_PARAM_SPEC_INT (spec)->minimum,
G_PARAM_SPEC_INT (spec)->maximum, G_PARAM_SPEC_INT (spec)->maximum,
@ -478,17 +477,17 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
if (can_modify) if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed", connect_controller (G_OBJECT (adj), "value_changed",
object, spec->name, (GtkSignalFunc) int_modified); object, spec->name, (GtkSignalFunc) int_modified);
break; }
else if (type == G_TYPE_PARAM_UINT)
case G_TYPE_PARAM_UINT: {
adj = GTK_ADJUSTMENT ( adj = GTK_ADJUSTMENT (
gtk_adjustment_new (G_PARAM_SPEC_UINT (spec)->default_value, gtk_adjustment_new (G_PARAM_SPEC_UINT (spec)->default_value,
G_PARAM_SPEC_UINT (spec)->minimum, G_PARAM_SPEC_UINT (spec)->minimum,
G_PARAM_SPEC_UINT (spec)->maximum, G_PARAM_SPEC_UINT (spec)->maximum,
1, 1,
MAX ((G_PARAM_SPEC_UINT (spec)->maximum - MAX ((G_PARAM_SPEC_UINT (spec)->maximum -
G_PARAM_SPEC_UINT (spec)->minimum) / 10, 1), G_PARAM_SPEC_UINT (spec)->minimum) / 10, 1),
0.0)); 0.0));
prop_edit = gtk_spin_button_new (adj, 1.0, 0); prop_edit = gtk_spin_button_new (adj, 1.0, 0);
@ -499,9 +498,10 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
if (can_modify) if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed", connect_controller (G_OBJECT (adj), "value_changed",
object, spec->name, (GtkSignalFunc) uint_modified); object, spec->name, (GtkSignalFunc) uint_modified);
break; }
else if (type == G_TYPE_PARAM_FLOAT)
case G_TYPE_PARAM_FLOAT: {
adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_FLOAT (spec)->default_value, adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_FLOAT (spec)->default_value,
G_PARAM_SPEC_FLOAT (spec)->minimum, G_PARAM_SPEC_FLOAT (spec)->minimum,
G_PARAM_SPEC_FLOAT (spec)->maximum, G_PARAM_SPEC_FLOAT (spec)->maximum,
@ -519,9 +519,9 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
if (can_modify) if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed", connect_controller (G_OBJECT (adj), "value_changed",
object, spec->name, (GtkSignalFunc) float_modified); object, spec->name, (GtkSignalFunc) float_modified);
break; }
else if (type == G_TYPE_PARAM_DOUBLE)
case G_TYPE_PARAM_DOUBLE: {
adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_DOUBLE (spec)->default_value, adj = GTK_ADJUSTMENT (gtk_adjustment_new (G_PARAM_SPEC_DOUBLE (spec)->default_value,
G_PARAM_SPEC_DOUBLE (spec)->minimum, G_PARAM_SPEC_DOUBLE (spec)->minimum,
G_PARAM_SPEC_DOUBLE (spec)->maximum, G_PARAM_SPEC_DOUBLE (spec)->maximum,
@ -539,9 +539,9 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
if (can_modify) if (can_modify)
connect_controller (G_OBJECT (adj), "value_changed", connect_controller (G_OBJECT (adj), "value_changed",
object, spec->name, (GtkSignalFunc) double_modified); object, spec->name, (GtkSignalFunc) double_modified);
break; }
else if (type == G_TYPE_PARAM_STRING)
case G_TYPE_PARAM_STRING: {
prop_edit = gtk_entry_new (); prop_edit = gtk_entry_new ();
g_object_connect_property (object, spec->name, g_object_connect_property (object, spec->name,
@ -551,9 +551,9 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
if (can_modify) if (can_modify)
connect_controller (G_OBJECT (prop_edit), "changed", connect_controller (G_OBJECT (prop_edit), "changed",
object, spec->name, (GtkSignalFunc) string_modified); object, spec->name, (GtkSignalFunc) string_modified);
break; }
else if (type == G_TYPE_PARAM_BOOLEAN)
case G_TYPE_PARAM_BOOLEAN: {
prop_edit = gtk_toggle_button_new_with_label (""); prop_edit = gtk_toggle_button_new_with_label ("");
g_object_connect_property (object, spec->name, g_object_connect_property (object, spec->name,
@ -563,9 +563,9 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
if (can_modify) if (can_modify)
connect_controller (G_OBJECT (prop_edit), "toggled", connect_controller (G_OBJECT (prop_edit), "toggled",
object, spec->name, (GtkSignalFunc) bool_modified); object, spec->name, (GtkSignalFunc) bool_modified);
break; }
else if (type == G_TYPE_PARAM_ENUM)
case G_TYPE_PARAM_ENUM: {
{ {
GtkWidget *menu; GtkWidget *menu;
GEnumClass *eclass; GEnumClass *eclass;
@ -603,9 +603,9 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
connect_controller (G_OBJECT (prop_edit), "changed", connect_controller (G_OBJECT (prop_edit), "changed",
object, spec->name, (GtkSignalFunc) enum_modified); object, spec->name, (GtkSignalFunc) enum_modified);
} }
break; }
else if (type == G_TYPE_PARAM_UNICHAR)
case G_TYPE_PARAM_UNICHAR: {
prop_edit = gtk_entry_new (); prop_edit = gtk_entry_new ();
gtk_entry_set_max_length (GTK_ENTRY (prop_edit), 1); gtk_entry_set_max_length (GTK_ENTRY (prop_edit), 1);
@ -616,33 +616,31 @@ property_widget (GObject *object, GParamSpec *spec, gboolean can_modify)
if (can_modify) if (can_modify)
connect_controller (G_OBJECT (prop_edit), "changed", connect_controller (G_OBJECT (prop_edit), "changed",
object, spec->name, (GtkSignalFunc) unichar_modified); object, spec->name, (GtkSignalFunc) unichar_modified);
break; }
else if (type == G_TYPE_PARAM_POINTER)
case G_TYPE_PARAM_POINTER: {
prop_edit = gtk_label_new (""); prop_edit = gtk_label_new ("");
g_object_connect_property (object, spec->name, g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (pointer_changed), GTK_SIGNAL_FUNC (pointer_changed),
prop_edit, G_OBJECT (prop_edit)); prop_edit, G_OBJECT (prop_edit));
break; }
else if (type == G_TYPE_PARAM_OBJECT)
case G_TYPE_PARAM_OBJECT: {
prop_edit = gtk_label_new (""); prop_edit = gtk_label_new ("");
g_object_connect_property (object, spec->name, g_object_connect_property (object, spec->name,
GTK_SIGNAL_FUNC (object_changed), GTK_SIGNAL_FUNC (object_changed),
prop_edit, G_OBJECT (prop_edit)); prop_edit, G_OBJECT (prop_edit));
break; }
else
{
default:
msg = g_strdup_printf ("uneditable property type: %s", msg = g_strdup_printf ("uneditable property type: %s",
g_type_name (G_PARAM_SPEC_TYPE (spec))); g_type_name (G_PARAM_SPEC_TYPE (spec)));
prop_edit = gtk_label_new (msg); prop_edit = gtk_label_new (msg);
g_free (msg); g_free (msg);
gtk_misc_set_alignment (GTK_MISC (prop_edit), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (prop_edit), 0.0, 0.5);
} }
#endif
return prop_edit; return prop_edit;
} }