On 2012-09-05 21:18, Anthony Liguori wrote: > This is minimalistic and just contains the basic widget infrastructure. The GUI > consists of a menu and a GtkNotebook. To start with, the notebook has its tabs > hidden which provides a UI that looks very similar to SDL with the exception of > the menu bar. > > The menu bar allows a user to toggle the visibility of the tabs. Cairo is used > for rendering. > > I used gtk-vnc as a reference. gtk-vnc solves the same basic problems as QEMU > since it was originally written as a remote display for QEMU. So for the most > part, the approach to rendering and keyboard handling should be pretty solid for > GTK. > > Signed-off-by: Anthony Liguori > --- > v1 -> v2 > - add gtk-vnc license > - fix key propagation ... > +static void gd_create_menus(GtkDisplayState *s) > +{ > + GtkStockItem item; > + GtkAccelGroup *accel_group; > + GSList *group = NULL; > + GtkWidget *separator; > + > + accel_group = gtk_accel_group_new(); > + s->file_menu = gtk_menu_new(); > + gtk_menu_set_accel_group(GTK_MENU(s->file_menu), accel_group); > + s->file_menu_item = gtk_menu_item_new_with_mnemonic("_File"); > + > + s->quit_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_QUIT, NULL); > + gtk_stock_lookup(GTK_STOCK_QUIT, &item); > + gtk_menu_item_set_accel_path(GTK_MENU_ITEM(s->quit_item), > + "/File/Quit"); > + gtk_accel_map_add_entry("/File/Quit", item.keyval, item.modifier); > + > + s->view_menu = gtk_menu_new(); > + gtk_menu_set_accel_group(GTK_MENU(s->view_menu), accel_group); > + s->view_menu_item = gtk_menu_item_new_with_mnemonic("_View"); > + > + separator = gtk_separator_menu_item_new(); > + gtk_menu_append(GTK_MENU(s->view_menu), separator); > + > + s->vga_item = gtk_radio_menu_item_new_with_mnemonic(group, "_VGA"); Minor nit, but "VGA" is the wrong name for QEMU in general. Maybe "Display"? Jan