mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 19:40:43 -05:00
Replaced deprecated symbols in metacity-window-demo.c
-Replaced calls to gtk_toolbar_insert_stock with gtk_toolbar_insert -Created appropriate GtkToolButton items
This commit is contained in:
parent
1a92fa788d
commit
066c870271
@ -825,6 +825,7 @@ do_appwindow (void)
|
|||||||
GtkTextBuffer *buffer;
|
GtkTextBuffer *buffer;
|
||||||
GtkAccelGroup *accel_group;
|
GtkAccelGroup *accel_group;
|
||||||
GtkItemFactory *item_factory;
|
GtkItemFactory *item_factory;
|
||||||
|
|
||||||
|
|
||||||
/* Create the toplevel window
|
/* Create the toplevel window
|
||||||
*/
|
*/
|
||||||
@ -905,45 +906,62 @@ do_appwindow (void)
|
|||||||
*/
|
*/
|
||||||
toolbar = gtk_toolbar_new ();
|
toolbar = gtk_toolbar_new ();
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
GtkToolItem *newButton = gtk_tool_button_new_from_stock(GTK_STOCK_NEW);
|
||||||
GTK_STOCK_NEW,
|
gtk_tool_item_set_tooltip_text(newButton,
|
||||||
"Open another one of these windows",
|
"Open another one of these windows");
|
||||||
NULL,
|
g_signal_connect(G_OBJECT(newButton),
|
||||||
G_CALLBACK (do_appwindow),
|
"clicked",
|
||||||
window, /* user data for callback */
|
G_CALLBACK(do_appwindow),
|
||||||
-1); /* -1 means "append" */
|
window);
|
||||||
|
gtk_toolbar_insert(GTK_TOOLBAR(toolbar),
|
||||||
|
newButton,
|
||||||
|
-1); /*-1 means append to end of toolbar*/
|
||||||
|
|
||||||
|
|
||||||
|
GtkToolItem *lockButton = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN);
|
||||||
|
gtk_tool_item_set_tooltip_text(lockButton,
|
||||||
|
"This is a demo button that locks up the demo");
|
||||||
|
g_signal_connect(G_OBJECT(lockButton),
|
||||||
|
"clicked",
|
||||||
|
G_CALLBACK(sleep_cb),
|
||||||
|
window);
|
||||||
|
gtk_toolbar_insert(GTK_TOOLBAR(toolbar),
|
||||||
|
lockButton,
|
||||||
|
-1); /*-1 means append to end of toolbar*/
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
|
||||||
GTK_STOCK_OPEN,
|
|
||||||
"This is a demo button that locks up the demo",
|
|
||||||
NULL,
|
|
||||||
G_CALLBACK (sleep_cb),
|
|
||||||
window, /* user data for callback */
|
|
||||||
-1); /* -1 means "append" */
|
|
||||||
|
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
GtkToolItem *decoButton = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN);
|
||||||
GTK_STOCK_OPEN,
|
gtk_tool_item_set_tooltip_text(decoButton,
|
||||||
"This is a demo button that toggles window decorations",
|
"This is a demo button that toggles window decorations");
|
||||||
NULL,
|
g_signal_connect(G_OBJECT(decoButton),
|
||||||
G_CALLBACK (toggle_decorated_cb),
|
"clicked",
|
||||||
window, /* user data for callback */
|
G_CALLBACK(toggle_decorated_cb),
|
||||||
-1); /* -1 means "append" */
|
window);
|
||||||
|
gtk_toolbar_insert(GTK_TOOLBAR(toolbar),
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
decoButton,
|
||||||
GTK_STOCK_OPEN,
|
-1); /*-1 means append to end of toolbar*/
|
||||||
"This is a demo button that locks the aspect ratio using a hint",
|
|
||||||
NULL,
|
GtkToolItem *lockRatioButton = gtk_tool_button_new_from_stock(GTK_STOCK_OPEN);
|
||||||
G_CALLBACK (toggle_aspect_ratio),
|
gtk_tool_item_set_tooltip_text(lockRatioButton,
|
||||||
contents, /* user data for callback */
|
"This is a demo button that locks the aspect ratio using a hint");
|
||||||
-1); /* -1 means "append" */
|
g_signal_connect(G_OBJECT(lockRatioButton),
|
||||||
|
"clicked",
|
||||||
gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
|
G_CALLBACK(toggle_aspect_ratio),
|
||||||
GTK_STOCK_QUIT,
|
window);
|
||||||
"This is a demo button with a 'quit' icon",
|
gtk_toolbar_insert(GTK_TOOLBAR(toolbar),
|
||||||
NULL,
|
lockRatioButton,
|
||||||
G_CALLBACK (clicked_toolbar_cb),
|
-1); /*-1 means append to end of toolbar*/
|
||||||
window, /* user data for callback */
|
|
||||||
-1); /* -1 means "append" */
|
GtkToolItem *quitButton = gtk_tool_button_new_from_stock(GTK_STOCK_QUIT);
|
||||||
|
gtk_tool_item_set_tooltip_text(quitButton,
|
||||||
|
"This is a demo button with a 'quit' icon");
|
||||||
|
g_signal_connect(G_OBJECT(quitButton),
|
||||||
|
"clicked",
|
||||||
|
G_CALLBACK(clicked_toolbar_cb),
|
||||||
|
window);
|
||||||
|
gtk_toolbar_insert(GTK_TOOLBAR(toolbar),
|
||||||
|
quitButton,
|
||||||
|
-1); /*-1 means append to end of toolbar*/
|
||||||
|
|
||||||
handlebox = gtk_handle_box_new ();
|
handlebox = gtk_handle_box_new ();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user