gtk/tests/testmenubars.c

51 lines
1.6 KiB
C
Raw Normal View History

Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
#include <gtk/gtk.h>
2012-05-26 03:14:02 +00:00
static void scale_moved(GtkWidget *widget, gpointer data)
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
{
2012-05-26 03:14:02 +00:00
g_print("%.1f\n", gtk_adjustment_get_value(GTK_ADJUSTMENT(data)));
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
}
2012-05-26 03:14:02 +00:00
int main(int argc, char **argv)
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
{
2012-05-26 03:14:02 +00:00
GtkWidget *window, *vbox, *toolbar, *scale;
GtkAdjustment *adjustment;
GtkStyleContext *context;
GtkToolItem *boxitem, *button;
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
gtk_init(&argc, &argv);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window), 300, 200);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
toolbar = gtk_toolbar_new();
context = gtk_widget_get_style_context(toolbar);
gtk_style_context_add_class(context, GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
adjustment = gtk_adjustment_new(0, 0, 10, 1, 2, 0);
scale = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, adjustment);
gtk_scale_set_value_pos(GTK_SCALE(scale), GTK_POS_RIGHT);
gtk_widget_set_size_request(scale, 255, -1);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
button = gtk_tool_button_new_from_stock(GTK_STOCK_QUIT);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
boxitem = gtk_tool_item_new();
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), button, 0);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), boxitem, 1);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
gtk_container_add(GTK_CONTAINER(vbox), toolbar);
gtk_container_add(GTK_CONTAINER(boxitem), scale);
gtk_container_add(GTK_CONTAINER(window), vbox);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(button, "clicked", G_CALLBACK(gtk_main_quit), NULL);
g_signal_connect(scale, "value-changed", G_CALLBACK(scale_moved), adjustment);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
gtk_widget_show_all(window);
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
gtk_main();
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
2012-05-26 03:14:02 +00:00
return 0;
Support vertical menubars (#166632): 2005-02-11 Matthias Clasen <mclasen@redhat.com> Support vertical menubars (#166632): * gtk/gtkenums.h (GtkPackDirection): New enumeration for pack directions, with values for left-to-right, right-to-left, top-to-bottom and bottom-to-top. * gtk/gtk.symbols: * gtk/gtkmenubar.h: * gtk/gtkmenubar.c: Add two properties, pack-direction and child-pack-direction, which specify how children and grandchildren of a menubar are packed, with getters and setters. * gtk/gtkmenubar.c (gtk_menu_bar_set_property): (gtk_menu_bar_get_property): Implement set_property and get_property. * gtk/gtkmenubar.c (gtk_menu_bar_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkmenubar.c (gtk_menu_bar_move_current): Implement move_current here move all the menubar-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenu.c (gtk_menu_move_current): Move menu-specific direction tweaking from the generic menushell implementation here. * gtk/gtkmenuitem.c (gtk_menu_item_size_request): (gtk_menu_bar_size_allocate): Take pack direction into account. * gtk/gtkimagemenuitem.c (gtk_image_menu_item_size_request) (gtk_image_menu_item_size_allocate): (gtk_image_menu_item_toggle_size_request): Take child pack direction into account and pack the image vertically if necessary. * gtk/gtkmenushell.c (gtk_menu_shell_real_select_item): Set the submenu direction to left-right for menuitems in vertical menubars. (gtk_real_menu_shell_move_current): Simplify by moving direction tweaking to menu- and menubar-specific implementations. Take pack direction into account when doing fallbacks. * tests/testmenubars.c: Test menubars in various packing direction combinations. * tests/Makefile.am (noinst_PROGRAMS): Add testmenubars.
2005-02-11 07:15:11 +00:00
}