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

-guess who ;)
This commit is contained in:
Tim Janik
1998-02-21 04:46:21 +00:00
parent 4c0ca9b968
commit 782dcc834b
5 changed files with 79 additions and 56 deletions

View File

@ -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);
@ -717,23 +720,26 @@ gtk_toolbar_insert_space (GtkToolbar *toolbar,
void
gtk_toolbar_append_widget (GtkToolbar *toolbar,
GtkWidget *widget,
const char *tooltip_text)
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)
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++;

View File

@ -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,

View File

@ -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 ();

View File

@ -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;
}

View File

@ -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 ();