Ejemplo n.º 1
0
/*--------------------------------------------------------------------
 * src_viewer::refresh
 *
 */
void src_viewer::refresh() {
  menu->remove( ROOT_MENU );
  create_file_menu();

  FileBlock* fb = current_file_block;
  current_file_block = 0;		// to force a redraw
  view( fb );
}
Ejemplo n.º 2
0
/*--------------------------------------------------------------------
 * src_viewer::create_window
 *
 */
void src_viewer::create_window() {
  inherited::create_window();

  infobar = new vmessage( toplevel );
  annote_column = text->add_column( 4 );
  current_file_name = no_source_file;

  create_file_menu();
  update_infobar();

  show( vman->get_selection() );
}
Ejemplo n.º 3
0
Archivo: menu.c Proyecto: yhsesq/yhs
/* Function definition */
void create_main_menu(Widget parent)
{
    /* Create the menu bar */
    argcount = 0;   
    menu_bar = XmCreateMenuBar(parent, "Menubar", args, argcount);
    XtManageChild(menu_bar);
    argcount=0;
    /* Attach submenus to it */
    create_file_menu(menu_bar);
    create_preprocessing_menu(menu_bar);
    create_segmentation_menu(menu_bar);
    create_tools_menu(menu_bar); 
    create_feature_menu(menu_bar);
    create_multi_menu(menu_bar);
    create_window_menu(menu_bar);
    create_about_menu(menu_bar);
    create_flasher(menu_bar);
}
Ejemplo n.º 4
0
void
edit_init_menu (struct WMenuBar *menubar)
{
    menubar_add_menu (menubar,
                      create_menu (_("&File"), create_file_menu (), "[Internal File Editor]"));
    menubar_add_menu (menubar,
                      create_menu (_("&Edit"), create_edit_menu (), "[Internal File Editor]"));
    menubar_add_menu (menubar,
                      create_menu (_("&Search"), create_search_replace_menu (),
                                   "[Internal File Editor]"));
    menubar_add_menu (menubar,
                      create_menu (_("&Command"), create_command_menu (),
                                   "[Internal File Editor]"));
    menubar_add_menu (menubar,
                      create_menu (_("For&mat"), create_format_menu (), "[Internal File Editor]"));
    menubar_add_menu (menubar,
                      create_menu (_("&Options"), create_options_menu (),
                                   "[Internal File Editor]"));
}
Ejemplo n.º 5
0
int
main (int argc, char *argv[])
{
  GtkWidget *box;
  GtkWidget *menubar;
  GtkWidget *menuitem;
  GtkWidget *menu;
  GtkWidget *button;
  GtkAccelGroup *accel_group;

  gtk_init (&argc, &argv);

  manager = gtk_recent_manager_get_default ();

  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window), -1, -1);
  gtk_window_set_title (GTK_WINDOW (window), "Recent Chooser Menu Test");
  g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);

  accel_group = gtk_accel_group_new ();
  gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
  
  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
  gtk_container_add (GTK_CONTAINER (window), box);
  gtk_widget_show (box);

  menubar = gtk_menu_bar_new ();
  gtk_box_pack_start (GTK_BOX (box), menubar, FALSE, TRUE, 0);
  gtk_widget_show (menubar);

  menu = create_file_menu (accel_group);
  menuitem = gtk_menu_item_new_with_mnemonic ("_File");
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
  gtk_widget_show (menuitem);

  menu = create_recent_chooser_menu (4);
  menuitem = gtk_menu_item_new_with_mnemonic ("_Recently Used");
  gtk_menu_item_set_submenu (GTK_MENU_ITEM (menuitem), menu);
  gtk_menu_shell_append (GTK_MENU_SHELL (menubar), menuitem);
  gtk_widget_show (menuitem);

  label = gtk_label_new ("No recent item selected");
  gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0);
  gtk_widget_show (label);

  button = gtk_button_new_with_label ("Close");
  g_signal_connect_swapped (button, "clicked",
                            G_CALLBACK (gtk_widget_destroy),
                            window);
  gtk_box_pack_end (GTK_BOX (box), button, TRUE, TRUE, 0);
  gtk_widget_set_can_default (button, TRUE);
  gtk_widget_grab_default (button);
  gtk_widget_show (button);

  gtk_widget_show (window);

  gtk_main ();

  return 0;
}