コード例 #1
0
int
main(int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget* math_view;
  xmlTextReader* reader;
  gtk_init (&argc, &argv);
    
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_show  (window);

  g_signal_connect(window,
		   "delete_event", 
		   G_CALLBACK(gtk_main_quit), NULL);

  math_view = gtk_math_view_new(NULL, NULL);
  reader = xmlReaderForFile(argv[1], NULL, 0);
  /*xmlTextReaderRead(reader);*/
  assert(reader);
  gtk_math_view_load_reader(GTK_MATH_VIEW(math_view), reader);
  gtk_container_add (GTK_CONTAINER (window), math_view);
    
  gtk_widget_show (math_view);
    
  gtk_main ();
  
  return 0;
}
コード例 #2
0
int
main(int argc, char *argv[])
{
  GtkWidget *window;
  GtkWidget* math_view;

  gtk_init (&argc, &argv);
    
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_widget_show  (window);

  g_signal_connect(GTK_OBJECT(window), 
		   "delete_event", 
		   (GtkSignalFunc) gtk_main_quit, NULL);

  math_view = gtk_math_view_new(NULL, NULL);
  gtk_math_view_load_uri(GTK_MATH_VIEW(math_view), argv[1]);
  gtk_container_add (GTK_CONTAINER (window), math_view);
    
  gtk_widget_show (math_view);
    
  gtk_main ();
  
  return 0;
}
コード例 #3
0
ファイル: mathml_viewer.c プロジェクト: moreorless/claws-mail
static MimeViewer *mathml_viewer_create(void)
{
	MathMLViewer *viewer;

	debug_print("mathml_viewer_create\n");
	
	viewer = g_new0(MathMLViewer, 1);
	viewer->mimeviewer.factory = &mathml_viewer_factory;

	viewer->mimeviewer.get_widget = mathml_get_widget;
	viewer->mimeviewer.show_mimepart = mathml_show_mimepart;
	viewer->mimeviewer.clear_viewer = mathml_clear_viewer;
	viewer->mimeviewer.destroy_viewer = mathml_destroy_viewer;	

	viewer->scrollwin = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(NULL, NULL));
	gtk_widget_show(GTK_WIDGET(viewer->scrollwin));
	gtk_widget_ref(GTK_WIDGET(viewer->scrollwin));
	gtk_scrolled_window_set_policy(viewer->scrollwin, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);

	viewer->mathview = GTK_MATH_VIEW(gtk_math_view_new(NULL, NULL));
	gtk_widget_show(GTK_WIDGET(viewer->mathview));
	viewer->filename = NULL;
	gtk_container_add(GTK_CONTAINER(viewer->scrollwin), GTK_WIDGET(viewer->mathview));

	return (MimeViewer *) viewer;
}