Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Development Team/Almanac
(view source)
Revision as of 07:21, 16 July 2009
223 bytes added
,
07:21, 16 July 2009
→How do I create a text box for code editing?
Line 99:
Line 99:
view.modify_font(pango.FontDescription("Monospace " +
view.modify_font(pango.FontDescription("Monospace " +
str(style.FONT_SIZE)))
str(style.FONT_SIZE)))
+
...
+
</pre>
</pre>
Line 109:
Line 111:
text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter())
text = buffer.get_text(buffer.get_start_iter(), buffer.get_end_iter())
</pre>
</pre>
+
+
You will probably want to put the view in a gtk.ScrolledWindow
+
<pre>
+
sw = gtk.ScrolledWindow()
+
sw.add(view)
+
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+
</pre>
+
and add the sw object instead of the view.
+
You can find more in the Pippy source and in jarabe.view.sourceview.
You can find more in the Pippy source and in jarabe.view.sourceview.
Lucian
158
edits