mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
Stop using gtk_toolbar_insert_stock()
Add helper functions instead of using this deprecated symbol. http://bugzilla.gnome.org/show_bug.cgi?id=587991 A# ../stamp-mutter-marshal.h
This commit is contained in:
parent
d0510d8ea2
commit
cc46d2ebb4
@ -285,7 +285,7 @@ response_cb (GtkDialog *dialog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
dialog_cb (gpointer callback_data,
|
dialog_cb (gpointer callback_data,
|
||||||
guint callback_action,
|
guint callback_action,
|
||||||
GtkWidget *widget)
|
GtkWidget *widget)
|
||||||
{
|
{
|
||||||
@ -812,6 +812,26 @@ destroy_cb (GtkWidget *w, gpointer data)
|
|||||||
gtk_main_quit ();
|
gtk_main_quit ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
insert_stock_button (GtkWidget *toolbar,
|
||||||
|
const gchar *stock_id,
|
||||||
|
const gchar *text,
|
||||||
|
GCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
GtkToolItem *button;
|
||||||
|
|
||||||
|
button = gtk_tool_button_new_from_stock (stock_id);
|
||||||
|
gtk_tool_item_set_tooltip_text (button, text);
|
||||||
|
g_signal_connect (G_OBJECT (button),
|
||||||
|
"clicked",
|
||||||
|
callback,
|
||||||
|
user_data);
|
||||||
|
gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
|
||||||
|
button,
|
||||||
|
-1); /*-1 means append to end of toolbar*/
|
||||||
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
do_appwindow (void)
|
do_appwindow (void)
|
||||||
{
|
{
|
||||||
@ -903,45 +923,25 @@ do_appwindow (void)
|
|||||||
*/
|
*/
|
||||||
toolbar = gtk_toolbar_new ();
|
toolbar = gtk_toolbar_new ();
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
insert_stock_button (toolbar, GTK_STOCK_NEW,
|
||||||
GTK_STOCK_NEW,
|
"Open another one of these windows",
|
||||||
"Open another one of these windows",
|
G_CALLBACK (do_appwindow), window);
|
||||||
NULL,
|
|
||||||
G_CALLBACK (do_appwindow),
|
|
||||||
window, /* user data for callback */
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
insert_stock_button (toolbar, GTK_STOCK_OPEN,
|
||||||
GTK_STOCK_OPEN,
|
"This is a demo button that locks up the demo",
|
||||||
"This is a demo button that locks up the demo",
|
G_CALLBACK (sleep_cb), window);
|
||||||
NULL,
|
|
||||||
G_CALLBACK (sleep_cb),
|
|
||||||
window, /* user data for callback */
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
insert_stock_button (toolbar, GTK_STOCK_OPEN,
|
||||||
GTK_STOCK_OPEN,
|
"This is a demo button that toggles window decorations",
|
||||||
"This is a demo button that toggles window decorations",
|
G_CALLBACK (toggle_decorated_cb), window);
|
||||||
NULL,
|
|
||||||
G_CALLBACK (toggle_decorated_cb),
|
|
||||||
window, /* user data for callback */
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
insert_stock_button (toolbar, GTK_STOCK_OPEN,
|
||||||
GTK_STOCK_OPEN,
|
"This is a demo button that locks the aspect ratio using a hint",
|
||||||
"This is a demo button that locks the aspect ratio using a hint",
|
G_CALLBACK (toggle_aspect_ratio), contents);
|
||||||
NULL,
|
|
||||||
G_CALLBACK (toggle_aspect_ratio),
|
|
||||||
contents, /* user data for callback */
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
insert_stock_button (toolbar, GTK_STOCK_QUIT,
|
||||||
GTK_STOCK_QUIT,
|
"This is a demo button with a 'quit' icon",
|
||||||
"This is a demo button with a 'quit' icon",
|
G_CALLBACK (clicked_toolbar_cb), window);
|
||||||
NULL,
|
|
||||||
G_CALLBACK (clicked_toolbar_cb),
|
|
||||||
window, /* user data for callback */
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
handlebox = gtk_handle_box_new ();
|
handlebox = gtk_handle_box_new ();
|
||||||
|
|
||||||
|
@ -86,6 +86,22 @@ static GtkItemFactoryEntry menu_items[] =
|
|||||||
{ N_("/Windows/Des_ktop"), NULL, NULL, 0, NULL }
|
{ N_("/Windows/Des_ktop"), NULL, NULL, 0, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
insert_stock_button (GtkWidget *toolbar,
|
||||||
|
const gchar *stock_id,
|
||||||
|
const gchar *text)
|
||||||
|
{
|
||||||
|
GtkToolItem *button;
|
||||||
|
|
||||||
|
button = gtk_tool_button_new_from_stock (stock_id);
|
||||||
|
gtk_tool_item_set_tooltip_text (button, text);
|
||||||
|
gtk_toolbar_insert (GTK_TOOLBAR (toolbar),
|
||||||
|
button,
|
||||||
|
-1); /*-1 means append to end of toolbar*/
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
normal_contents (void)
|
normal_contents (void)
|
||||||
{
|
{
|
||||||
@ -131,26 +147,12 @@ normal_contents (void)
|
|||||||
*/
|
*/
|
||||||
toolbar = gtk_toolbar_new ();
|
toolbar = gtk_toolbar_new ();
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
insert_stock_button (toolbar, GTK_STOCK_NEW,
|
||||||
GTK_STOCK_NEW,
|
_("Open another one of these windows"));
|
||||||
_("Open another one of these windows"),
|
insert_stock_button (toolbar, GTK_STOCK_OPEN,
|
||||||
NULL,
|
_("This is a demo button with an 'open' icon"));
|
||||||
NULL, NULL,
|
insert_stock_button (toolbar, GTK_STOCK_QUIT,
|
||||||
-1); /* -1 means "append" */
|
_("This is a demo button with a 'quit' icon"));
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
|
||||||
GTK_STOCK_OPEN,
|
|
||||||
_("This is a demo button with an 'open' icon"),
|
|
||||||
NULL,
|
|
||||||
NULL, NULL,
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
|
||||||
GTK_STOCK_QUIT,
|
|
||||||
_("This is a demo button with a 'quit' icon"),
|
|
||||||
NULL,
|
|
||||||
NULL, NULL,
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
handlebox = gtk_handle_box_new ();
|
handlebox = gtk_handle_box_new ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user