Example #1
0
void
show_tutorial ()
{
  GString* tutorial_text = read_tutorial ();
  GtkWidget *cont;

  /* show */
  tutorial = create_window_tutorial ();
  cont = lookup_widget (tutorial, "tutorial_vbox");
  g_assert (cont);
  edit = gui_editor_new ();
  g_assert (edit);
  gui_editor_show (edit);
  if (tutorial_text == NULL)
  {
    tutorial_text = g_string_new (_("The tutorial file, asm-guide.txt, was not found. It should be present in directory - "));
    g_string_append (tutorial_text, PACKAGE_DOC_DIR);  
  }
  gui_editor_set_text (edit, tutorial_text->str);
  gui_editor_set_readonly (edit, TRUE);
  gui_editor_set_show_line_numbers (edit, FALSE);
  gtk_box_pack_end (GTK_BOX (cont), edit->scroll, TRUE, TRUE, 0);
  gtk_window_maximize (GTK_WINDOW (tutorial));
  gtk_widget_show_all (tutorial);

  /* clean up */
  g_string_free (tutorial_text, TRUE);
}
Example #2
0
void
on_show_listing1_activate (GtkMenuItem * menuitem, gpointer user_data)
{
  GString *list;
  GtkWidget *cont;

  /* assemble */
  on_assemble1_activate (NULL, NULL);
  if (asm_error == FALSE)
	return;

  list = asm_listing_generate (b_get_src ());

  //gui_editor_set_text (app->editor, list->str);

  /* show */
  wind = create_window_listing ();
  cont = lookup_widget (wind, "listing_vbox");
  g_assert (cont);
  edit = gui_editor_new ();
  g_assert (edit);
  gui_editor_show (edit);
  gui_editor_set_text (edit, list->str);
  gui_editor_set_readonly (edit, TRUE);
  gtk_box_pack_end (GTK_BOX (cont), edit->scroll, TRUE, TRUE, 0);
  gtk_window_maximize (GTK_WINDOW (wind));
  gtk_widget_show_all (wind);
  /* TODO clean up of listing window editor on delete event */

  /* clean up */
  g_string_free (list, TRUE);
}
Example #3
0
void
gui_app_new (void)
{
  GtkPaned *p_msg, *p_data;
  /*GdkScreen *screen;*/
  g_assert (app == NULL);
  app = g_malloc0 (sizeof (GUIApp));

  app->window_main = create_window_main ();
  gtk_window_maximize (GTK_WINDOW (app->window_main));

  app->editor = gui_editor_new ();
  gui_editor_set_margin_toggle_mark (app->editor);
  gui_editor_show (app->editor);

  /* add editor */
  container = lookup_widget (app->window_main, "main_vbox_center");
  g_assert (container);

  gtk_box_pack_start_defaults (GTK_BOX (container),
							   app->editor->scroll);

  /* dim */
  //gtk_window_get_size(app->window_main, &w, &h);

  p_msg = GTK_PANED (lookup_widget
					 (app->window_main, "main_hpaned_msg"));
  g_assert (p_msg);
  p_data = GTK_PANED (lookup_widget
					  (app->window_main, "main_vpaned_data"));
  g_assert (p_data);

  /* get screen 
	 screen = gdk_screen_get_default ();
	 w = gdk_screen_get_width (screen);
	 h = gdk_screen_get_height (screen);

	 g_message ("screen w = %d", w);
	 g_message ("screen h = %d", h);*/

  /* maximize window FIXME - not working in other wms say IceWM */
  gtk_window_maximize (GTK_WINDOW (app->window_main));

  //FIXME properly allocate spaces to widgets?
  //gtk_paned_set_position (p_data, w);
  //gtk_paned_set_position (p_msg, h/2);
}