Commit e260fd6a authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Added gtk_menu_set_title() to set the title of a menu in the torn-off

Mon Jan 18 13:25:14 1999  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
	set the title of a menu in the torn-off state.

	* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
	of theme engine fails, just warn and do without -
	don't error out.

	* gtk/gtkmain.c (gtk_check_version): s/to/too/.
parent deb20a3c
Mon Jan 18 13:25:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
set the title of a menu in the torn-off state.
* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
of theme engine fails, just warn and do without -
don't error out.
* gtk/gtkmain.c (gtk_check_version): s/to/too/.
Mon Jan 18 01:21:03 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): fixed auto resize bug.
......
Mon Jan 18 13:25:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
set the title of a menu in the torn-off state.
* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
of theme engine fails, just warn and do without -
don't error out.
* gtk/gtkmain.c (gtk_check_version): s/to/too/.
Mon Jan 18 01:21:03 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): fixed auto resize bug.
......
Mon Jan 18 13:25:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
set the title of a menu in the torn-off state.
* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
of theme engine fails, just warn and do without -
don't error out.
* gtk/gtkmain.c (gtk_check_version): s/to/too/.
Mon Jan 18 01:21:03 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): fixed auto resize bug.
......
Mon Jan 18 13:25:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
set the title of a menu in the torn-off state.
* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
of theme engine fails, just warn and do without -
don't error out.
* gtk/gtkmain.c (gtk_check_version): s/to/too/.
Mon Jan 18 01:21:03 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): fixed auto resize bug.
......
Mon Jan 18 13:25:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
set the title of a menu in the torn-off state.
* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
of theme engine fails, just warn and do without -
don't error out.
* gtk/gtkmain.c (gtk_check_version): s/to/too/.
Mon Jan 18 01:21:03 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): fixed auto resize bug.
......
Mon Jan 18 13:25:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
set the title of a menu in the torn-off state.
* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
of theme engine fails, just warn and do without -
don't error out.
* gtk/gtkmain.c (gtk_check_version): s/to/too/.
Mon Jan 18 01:21:03 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): fixed auto resize bug.
......
Mon Jan 18 13:25:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmenu.[ch]: Added gtk_menu_set_title() to
set the title of a menu in the torn-off state.
* gtk/gtkthemes.c (gtk_theme_engine_get): When loading
of theme engine fails, just warn and do without -
don't error out.
* gtk/gtkmain.c (gtk_check_version): s/to/too/.
Mon Jan 18 01:21:03 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (draw_row): fixed auto resize bug.
......
......@@ -149,17 +149,17 @@ gtk_check_version (guint required_major,
guint required_micro)
{
if (required_major > GTK_MAJOR_VERSION)
return "Gtk+ version to old (major mismatch)";
return "Gtk+ version too old (major mismatch)";
if (required_major < GTK_MAJOR_VERSION)
return "Gtk+ version to new (major mismatch)";
return "Gtk+ version too new (major mismatch)";
if (required_minor > GTK_MINOR_VERSION)
return "Gtk+ version to old (minor mismatch)";
return "Gtk+ version too old (minor mismatch)";
if (required_minor < GTK_MINOR_VERSION)
return "Gtk+ version to new (minor mismatch)";
return "Gtk+ version too new (minor mismatch)";
if (required_micro < GTK_MICRO_VERSION - GTK_BINARY_AGE)
return "Gtk+ version to new (micro mismatch)";
return "Gtk+ version too new (micro mismatch)";
if (required_micro > GTK_MICRO_VERSION)
return "Gtk+ version to old (micro mismatch)";
return "Gtk+ version too old (micro mismatch)";
return NULL;
}
......
......@@ -602,6 +602,7 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
if (!menu->tearoff_window)
{
GtkWidget *attach_widget;
gchar *title;
menu->tearoff_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_set_app_paintable (menu->tearoff_window, TRUE);
......@@ -611,18 +612,21 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
GTK_OBJECT (menu));
gtk_widget_realize (menu->tearoff_window);
attach_widget = gtk_menu_get_attach_widget (menu);
if (GTK_IS_MENU_ITEM (attach_widget))
title = gtk_object_get_data (GTK_OBJECT (menu), "gtk-menu-title");
if (!title)
{
GtkWidget *child = GTK_BIN (attach_widget)->child;
if (GTK_IS_LABEL (child))
attach_widget = gtk_menu_get_attach_widget (menu);
if (GTK_IS_MENU_ITEM (attach_widget))
{
gchar *ret;
gtk_label_get (GTK_LABEL (child), &ret);
gdk_window_set_title (menu->tearoff_window->window, ret);
GtkWidget *child = GTK_BIN (attach_widget)->child;
if (GTK_IS_LABEL (child))
gtk_label_get (GTK_LABEL (child), &title);
}
}
if (title)
gdk_window_set_title (menu->tearoff_window->window, title);
gdk_window_set_decorations (menu->tearoff_window->window,
GDK_DECOR_ALL |
GDK_DECOR_RESIZEH |
......@@ -646,6 +650,17 @@ gtk_menu_set_tearoff_state (GtkMenu *menu,
}
}
void
gtk_menu_set_title (GtkMenu *menu,
const gchar *title)
{
g_return_if_fail (menu != NULL);
g_return_if_fail (GTK_IS_MENU (menu));
gtk_object_set_data_full (GTK_OBJECT (menu), "gtk-menu-title",
g_strdup (title), (GtkDestroyNotify) g_free);
}
static void
gtk_menu_realize (GtkWidget *widget)
{
......
......@@ -128,8 +128,14 @@ void gtk_menu_detach (GtkMenu *menu);
GtkWidget* gtk_menu_get_attach_widget (GtkMenu *menu);
void gtk_menu_detach (GtkMenu *menu);
void gtk_menu_set_tearoff_state (GtkMenu *menu,
gboolean torn_off);
void gtk_menu_set_tearoff_state (GtkMenu *menu,
gboolean torn_off);
/* This sets the window manager title for the window that
* appears when a menu is torn off
*/
void gtk_menu_set_title (GtkMenu *menu,
const gchar *title);
#ifdef __cplusplus
}
......
......@@ -81,7 +81,10 @@ gtk_theme_engine_get (gchar *name)
library = g_module_open (engine_path, 0);
g_free(engine_path);
if (!library)
g_error(g_module_error());
{
g_warning (g_module_error());
return NULL;
}
else
{
result = g_new (GtkThemeEnginePrivate, 1);
......@@ -96,7 +99,7 @@ gtk_theme_engine_get (gchar *name)
!g_module_symbol (library, "theme_exit",
(gpointer *)&result->exit))
{
g_error (g_module_error());
g_warning (g_module_error());
g_free (result);
return NULL;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment