summaryrefslogtreecommitdiff
path: root/perf/textview.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2005-07-29 00:38:51 +0000
committerFederico Mena Quintero <federico@src.gnome.org>2005-07-29 00:38:51 +0000
commitb4f52020f0fd86ddda88cdded1e4e84b47f384b6 (patch)
tree1b22478a6f40c3351474d546fb617f72b81418ec /perf/textview.c
parent375cb32bc107b1e69be49689fd096b1c961d94af (diff)
downloadgtk+-b4f52020f0fd86ddda88cdded1e4e84b47f384b6.tar.gz
Update for the new API of the profiler.
2005-07-28 Federico Mena Quintero <federico@ximian.com> * perf/README: Update for the new API of the profiler. * perf/gtkwidgetprofiler.[ch]: New files with a widget profiler object. This is the old content of timers.[ch] turned into a nice object, with signals for creation and reporting. The profiler needs to maintain some state when reusing the widget, so it's useful to turn it into a real object. Break down timing show_all into GTK_WIDGET_PROFILER_REPORT_MAP and GTK_WIDGET_PROFILER_REPORT_EXPOSE. * perf/main.c: Refactor to use GtkWidgetProfiler. * perf/appwindow.c (content_area_new): Make this just create a notebook, instead of a complex arrangement of panes. * perf/widgets.h: New header file for all the "create a widget" utility functions. * perf/treeview.c: New file. Moved the tree view part from appwindow.c over to here; GtkTreeView really needs its own tests. (tree_view_new): Set the shadow type to IN. * perf/textview.c: Likewise moved over from appwindow.c, but for GtkTextView. (text_view_new): Set the shadow type to IN. * perf/Makefile.am (testperf_SOURCES): Add the new source files; remove appwindow.h and timers.[ch]. * perf/timers.[ch]: Removed. * perf/appwindow.h: Removed.
Diffstat (limited to 'perf/textview.c')
-rw-r--r--perf/textview.c60
1 files changed, 60 insertions, 0 deletions
diff --git a/perf/textview.c b/perf/textview.c
new file mode 100644
index 0000000000..0590c8af78
--- /dev/null
+++ b/perf/textview.c
@@ -0,0 +1,60 @@
+#include <gtk/gtk.h>
+#include "widgets.h"
+
+GtkWidget *
+text_view_new (void)
+{
+ GtkWidget *sw;
+ GtkWidget *text_view;
+ GtkTextBuffer *buffer;
+
+ sw = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
+
+ text_view = gtk_text_view_new ();
+ gtk_widget_set_size_request (text_view, 400, 300);
+ gtk_container_add (GTK_CONTAINER (sw), text_view);
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
+
+ gtk_text_buffer_set_text (buffer,
+ "In felaweshipe, and pilgrimes were they alle,\n"
+ "That toward Caunterbury wolden ryde.\n"
+ "The chambres and the stables weren wyde,\n"
+ "And wel we weren esed atte beste;\n"
+ "And shortly, whan the sonne was to reste,\n"
+ "\n"
+ "So hadde I spoken with hem everychon \n"
+ "That I was of hir felaweshipe anon, \n"
+ "And made forward erly for to ryse \n"
+ "To take our wey, ther as I yow devyse. \n"
+ " But nathelees, whil I have tyme and space, \n"
+ " \n"
+ "Er that I ferther in this tale pace, \n"
+ "Me thynketh it acordaunt to resoun \n"
+ "To telle yow al the condicioun \n"
+ "Of ech of hem, so as it semed me, \n"
+ "And whiche they weren, and of what degree, \n"
+ " \n"
+ "And eek in what array that they were inne; \n"
+ "And at a knyght than wol I first bigynne. \n"
+ " A knyght ther was, and that a worthy man, \n"
+ "That fro the tyme that he first bigan \n"
+ "To riden out, he loved chivalrie, \n"
+ " \n"
+ "Trouthe and honour, fredom and curteisie. \n"
+ "Ful worthy was he in his lordes werre, \n"
+ " \n"
+ "And therto hadde he riden, no man ferre, \n"
+ "As wel in Cristendom as in Hethenesse, \n"
+ "And evere honoured for his worthynesse. \n"
+ " \n"
+ " At Alisaundre he was, whan it was wonne; \n"
+ "Ful ofte tyme he hadde the bord bigonne \n"
+ "Aboven alle nacions in Pruce; \n"
+ "In Lettow hadde he reysed, and in Ruce, \n"
+ "No cristen man so ofte of his degree. \n",
+ -1);
+
+ return sw;
+}