Commit 782dcc83 authored by Tim Janik's avatar Tim Janik

api changes to GtkToolBar to support the private tooltips text also.

-guess who ;)
parent 4c0ca9b9
......@@ -496,7 +496,7 @@ gtk_toolbar_add (GtkContainer *container,
g_return_if_fail (GTK_IS_TOOLBAR (container));
g_return_if_fail (widget != NULL);
gtk_toolbar_append_widget (GTK_TOOLBAR (container), widget, NULL);
gtk_toolbar_append_widget (GTK_TOOLBAR (container), widget, NULL, NULL);
}
static void
......@@ -565,11 +565,12 @@ GtkWidget *
gtk_toolbar_append_item (GtkToolbar *toolbar,
const char *text,
const char *tooltip_text,
const char *tooltip_private_text,
GtkWidget *icon,
GtkSignalFunc callback,
gpointer user_data)
{
return gtk_toolbar_insert_item (toolbar, text, tooltip_text, icon,
return gtk_toolbar_insert_item (toolbar, text, tooltip_text, tooltip_private_text, icon,
callback, user_data, toolbar->num_children);
}
......@@ -577,11 +578,12 @@ GtkWidget *
gtk_toolbar_prepend_item (GtkToolbar *toolbar,
const char *text,
const char *tooltip_text,
const char *tooltip_private_text,
GtkWidget *icon,
GtkSignalFunc callback,
gpointer user_data)
{
return gtk_toolbar_insert_item (toolbar, text, tooltip_text, icon,
return gtk_toolbar_insert_item (toolbar, text, tooltip_text, tooltip_private_text, icon,
callback, user_data, 0);
}
......@@ -589,6 +591,7 @@ GtkWidget *
gtk_toolbar_insert_item (GtkToolbar *toolbar,
const char *text,
const char *tooltip_text,
const char *tooltip_private_text,
GtkWidget *icon,
GtkSignalFunc callback,
gpointer user_data,
......@@ -610,7 +613,7 @@ gtk_toolbar_insert_item (GtkToolbar *toolbar,
callback, user_data);
if (tooltip_text)
gtk_tooltips_set_tips (toolbar->tooltips, child->widget, tooltip_text);
gtk_tooltips_set_tip (toolbar->tooltips, child->widget, tooltip_text, tooltip_private_text);
if (text)
child->label = gtk_label_new (text);
......@@ -715,25 +718,28 @@ gtk_toolbar_insert_space (GtkToolbar *toolbar,
}
void
gtk_toolbar_append_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const char *tooltip_text)
gtk_toolbar_append_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const gchar *tooltip_text,
const gchar *tooltip_private_text)
{
gtk_toolbar_insert_widget (toolbar, widget, tooltip_text, toolbar->num_children);
gtk_toolbar_insert_widget (toolbar, widget, tooltip_text, tooltip_private_text, toolbar->num_children);
}
void
gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const char *tooltip_text)
gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const gchar *tooltip_text,
const gchar *tooltip_private_text)
{
gtk_toolbar_insert_widget (toolbar, widget, tooltip_text, 0);
gtk_toolbar_insert_widget (toolbar, widget, tooltip_text, tooltip_private_text, 0);
}
void
gtk_toolbar_insert_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const char *tooltip_text,
const char *tooltip_private_text,
gint position)
{
GtkToolbarChild *child;
......@@ -748,7 +754,7 @@ gtk_toolbar_insert_widget (GtkToolbar *toolbar,
child->label = NULL;
if (tooltip_text)
gtk_tooltips_set_tips (toolbar->tooltips, child->widget, tooltip_text);
gtk_tooltips_set_tip (toolbar->tooltips, child->widget, tooltip_text, tooltip_private_text);
toolbar->children = g_list_insert (toolbar->children, child, position);
toolbar->num_children++;
......
......@@ -92,18 +92,21 @@ GtkWidget *gtk_toolbar_new (GtkOrientation orientation,
GtkWidget *gtk_toolbar_append_item (GtkToolbar *toolbar,
const char *text,
const char *tooltip_text,
const char *tooltip_private_text,
GtkWidget *icon,
GtkSignalFunc callback,
gpointer user_data);
GtkWidget *gtk_toolbar_prepend_item (GtkToolbar *toolbar,
const char *text,
const char *tooltip_text,
const char *tooltip_private_text,
GtkWidget *icon,
GtkSignalFunc callback,
gpointer user_data);
GtkWidget *gtk_toolbar_insert_item (GtkToolbar *toolbar,
const char *text,
const char *tooltip_text,
const char *tooltip_private_text,
GtkWidget *icon,
GtkSignalFunc callback,
gpointer user_data,
......@@ -114,13 +117,16 @@ void gtk_toolbar_insert_space (GtkToolbar *toolbar,
gint position);
void gtk_toolbar_append_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const char *tooltip_text);
const char *tooltip_text,
const char *tooltip_private_text);
void gtk_toolbar_prepend_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const char *tooltip_text);
const char *tooltip_text,
const char *tooltip_private_text);
void gtk_toolbar_insert_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const char *tooltip_text,
const char *tooltip_private_text,
gint position);
void gtk_toolbar_set_orientation (GtkToolbar *toolbar,
......
......@@ -662,26 +662,26 @@ create_toolbar (void)
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Horizontal", "Horizontal toolbar layout",
"Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_horizontal, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Vertical", "Vertical toolbar layout",
"Vertical", "Vertical toolbar layout", "Toolbar/Vertical",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_vertical, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Icons", "Only show toolbar icons",
"Icons", "Only show toolbar icons", "Toolbar/IconsOnly",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_icons, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Text", "Only show toolbar text",
"Text", "Only show toolbar text", "Toolbar/TextOnly",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_text, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Both", "Show toolbar icons and text",
"Both", "Show toolbar icons and text", "Toolbar/Both",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_both, toolbar);
......@@ -689,27 +689,27 @@ create_toolbar (void)
entry = gtk_entry_new ();
gtk_widget_show(entry);
gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), entry, NULL);
gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), entry, "This is an unusable GtkEntry ;)", "Hey don't click me!!!");
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Small", "Use small spaces",
"Small", "Use small spaces", "Toolbar/Small",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_small_space, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Big", "Use big spaces",
"Big", "Use big spaces", "Toolbar/Big",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_big_space, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Enable", "Enable tooltips",
"Enable", "Enable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_enable, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Disable", "Disable tooltips",
"Disable", "Disable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_disable, toolbar);
......@@ -734,48 +734,48 @@ make_toolbar (GtkWidget *window)
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Horizontal", "Horizontal toolbar layout",
"Horizontal", "Horizontal toolbar layout", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_horizontal, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Vertical", "Vertical toolbar layout",
"Vertical", "Vertical toolbar layout", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_vertical, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Icons", "Only show toolbar icons",
"Icons", "Only show toolbar icons", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_icons, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Text", "Only show toolbar text",
"Text", "Only show toolbar text", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_text, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Both", "Show toolbar icons and text",
"Both", "Show toolbar icons and text", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_both, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Small", "Use small spaces",
"Small", "Use small spaces", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_small_space, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Big", "Use big spaces",
"Big", "Use big spaces", "Toolbar/Big",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_big_space, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Enable", "Enable tooltips",
"Enable", "Enable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_enable, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Disable", "Disable tooltips",
"Disable", "Disable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_disable, toolbar);
......@@ -4330,7 +4330,11 @@ main (int argc, char *argv[])
gtk_set_locale ();
gtk_init (&argc, &argv);
/* gle_init (&argc, &argv); */
#ifdef HAVE_LIBGLE
gle_init (&argc, &argv);
#endif /* !HAVE_LIBGLE */
gtk_rc_parse ("testgtkrc");
create_main_window ();
......
......@@ -193,7 +193,8 @@ void create_tree_page(GtkWidget* parent, GtkSelectionMode mode,
gtk_object_set_user_data(GTK_OBJECT(root), (gpointer)tree_buttons);
}
void main(int argc, char** argv) {
int main(int argc, char** argv)
{
GtkWidget* window, *notebook;
GtkWidget* box1;
GtkWidget* separator;
......@@ -236,4 +237,6 @@ void main(int argc, char** argv) {
gtk_widget_show(window);
gtk_main();
return 0;
}
......@@ -662,26 +662,26 @@ create_toolbar (void)
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Horizontal", "Horizontal toolbar layout",
"Horizontal", "Horizontal toolbar layout", "Toolbar/Horizontal",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_horizontal, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Vertical", "Vertical toolbar layout",
"Vertical", "Vertical toolbar layout", "Toolbar/Vertical",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_vertical, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Icons", "Only show toolbar icons",
"Icons", "Only show toolbar icons", "Toolbar/IconsOnly",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_icons, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Text", "Only show toolbar text",
"Text", "Only show toolbar text", "Toolbar/TextOnly",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_text, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Both", "Show toolbar icons and text",
"Both", "Show toolbar icons and text", "Toolbar/Both",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_both, toolbar);
......@@ -689,27 +689,27 @@ create_toolbar (void)
entry = gtk_entry_new ();
gtk_widget_show(entry);
gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), entry, NULL);
gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), entry, "This is an unusable GtkEntry ;)", "Hey don't click me!!!");
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Small", "Use small spaces",
"Small", "Use small spaces", "Toolbar/Small",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_small_space, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Big", "Use big spaces",
"Big", "Use big spaces", "Toolbar/Big",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_big_space, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Enable", "Enable tooltips",
"Enable", "Enable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_enable, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Disable", "Disable tooltips",
"Disable", "Disable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_disable, toolbar);
......@@ -734,48 +734,48 @@ make_toolbar (GtkWidget *window)
toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Horizontal", "Horizontal toolbar layout",
"Horizontal", "Horizontal toolbar layout", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_horizontal, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Vertical", "Vertical toolbar layout",
"Vertical", "Vertical toolbar layout", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_vertical, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR(toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Icons", "Only show toolbar icons",
"Icons", "Only show toolbar icons", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_icons, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Text", "Only show toolbar text",
"Text", "Only show toolbar text", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_text, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Both", "Show toolbar icons and text",
"Both", "Show toolbar icons and text", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_both, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Small", "Use small spaces",
"Small", "Use small spaces", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_small_space, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Big", "Use big spaces",
"Big", "Use big spaces", "Toolbar/Big",
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_big_space, toolbar);
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Enable", "Enable tooltips",
"Enable", "Enable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_enable, toolbar);
gtk_toolbar_append_item (GTK_TOOLBAR (toolbar),
"Disable", "Disable tooltips",
"Disable", "Disable tooltips", NULL,
new_pixmap ("test.xpm", window->window, &window->style->bg[GTK_STATE_NORMAL]),
(GtkSignalFunc) set_toolbar_disable, toolbar);
......@@ -4330,7 +4330,11 @@ main (int argc, char *argv[])
gtk_set_locale ();
gtk_init (&argc, &argv);
/* gle_init (&argc, &argv); */
#ifdef HAVE_LIBGLE
gle_init (&argc, &argv);
#endif /* !HAVE_LIBGLE */
gtk_rc_parse ("testgtkrc");
create_main_window ();
......
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