Skip to main content

A styled text widget for wxpython.

Project description

WXTextView

Wxtextview is widget for the wx toolkit and is written completely in python. It has the functionality of a rich text editor and can handle even very long texts without beeing slow. All layout and editor logic is implemented in python. Only basic drawing commands are used from the wx toolkit. It is therefore easy to adapt it to other GUI-toolkits.

There are two demos showing advanced possibilities of WXTextView:

notebook.py:

A notebook interface similar to mathematica / ipython

math_demo.py:

A demonstration of editing math equations

1. USAGE

Running the demos:

Just cd to the demo directory and execute the scripts. No installation is needed. External dependencies are textmodel (all demos), wxpython (all demos) and matplotlib (notebook). The demos were tested on linux, windows and mac platforms.

$ cd demo/
$ python demo1.py

Using the wxtextview-widget:

from wxtextview import WXTextView
from textmodel import TextModel

import wx
app = wx.App()


model = TextModel(u'Hello World!')
model.set_properties(6, 11, fontsize=14)
model.set_properties(6, 11, bgcolor='yellow')

# display the texmodel in a view
frame = wx.Frame(None)
view = WXTextView(frame, -1)
view.model = model
frame.Show()

# set cursor and selection
view.index = 5
view.selection = 0, 5

# display the same textmodel in a second view
frame2 = wx.Frame(None)
view2 = WXTextView(frame2, -1)
view2.model = model
frame2.Show()

app.MainLoop()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wxtextview-0.3.6.tar.gz (35.7 kB view details)

Uploaded Source

File details

Details for the file wxtextview-0.3.6.tar.gz.

File metadata

  • Download URL: wxtextview-0.3.6.tar.gz
  • Upload date:
  • Size: 35.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wxtextview-0.3.6.tar.gz
Algorithm Hash digest
SHA256 b20acc1132db3d85d8a2463f24a210edf8c41fba20b46643ed964ee1f718b70d
MD5 70ba4085e25136229073c03f536cb369
BLAKE2b-256 f10e813e12b97946f407b7789dbab70566dfbaca0daf76df2a7a3ff673d24c76

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page