A start on docs for VUI.
It's hella crude yet.
This commit is contained in:
+11
-1
@@ -17,6 +17,14 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
'''
|
||||
|
||||
Core
|
||||
=====================
|
||||
|
||||
|
||||
A Module docstring yo.
|
||||
'''
|
||||
from sys import stderr
|
||||
from traceback import format_exc
|
||||
import pygame
|
||||
@@ -39,8 +47,9 @@ MOUSE_EVENTS = frozenset({
|
||||
pygame.MOUSEBUTTONDOWN,
|
||||
pygame.MOUSEBUTTONUP
|
||||
})
|
||||
# AM I DOCSY?
|
||||
|
||||
|
||||
# What about *moi?*
|
||||
ARROW_KEYS = frozenset({
|
||||
pygame.K_UP,
|
||||
pygame.K_DOWN,
|
||||
@@ -68,6 +77,7 @@ SUCCESS = 1
|
||||
|
||||
|
||||
class Message(object):
|
||||
'''Message class.'''
|
||||
|
||||
def __init__(self, sender):
|
||||
self.sender = sender
|
||||
|
||||
+5
-1
@@ -18,6 +18,10 @@
|
||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
'''
|
||||
|
||||
Display
|
||||
=================
|
||||
|
||||
This module implements a simple visual display system modeled on Oberon.
|
||||
|
||||
Refer to Chapter 4 of the Project Oberon book for more information.
|
||||
@@ -355,7 +359,7 @@ class Track(Viewer):
|
||||
return self, y
|
||||
|
||||
def open_viewer(self, y, class_):
|
||||
'''Open and return a viewer of class_ at y.'''
|
||||
'''Open and return a viewer of class at y.'''
|
||||
# Todo: if y coincides with some other viewer's y replace it.
|
||||
viewer, viewer_y = self.viewer_at(y)
|
||||
h = viewer.split(viewer_y)
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
'''
|
||||
|
||||
Stack Viewer
|
||||
=================
|
||||
|
||||
'''
|
||||
from joy.utils.stack import expression_to_string, iter_stack
|
||||
from joy.vui import core, text_viewer
|
||||
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Thun. If not see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
'''
|
||||
|
||||
Text Viewer
|
||||
=================
|
||||
|
||||
'''
|
||||
import string
|
||||
import pygame
|
||||
from joy.utils.stack import expression_to_string
|
||||
|
||||
@@ -17,11 +17,20 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with joy.py. If not see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
'''
|
||||
|
||||
Viewer
|
||||
=================
|
||||
|
||||
'''
|
||||
import pygame
|
||||
from joy.vui.core import BACKGROUND, FOREGROUND
|
||||
|
||||
|
||||
class Viewer(object):
|
||||
'''
|
||||
Base Viewer class
|
||||
'''
|
||||
|
||||
MINIMUM_HEIGHT = 11
|
||||
|
||||
@@ -97,6 +106,10 @@ class Viewer(object):
|
||||
|
||||
class MenuViewer(Viewer):
|
||||
|
||||
'''
|
||||
MenuViewer class
|
||||
'''
|
||||
|
||||
MINIMUM_HEIGHT = 26
|
||||
|
||||
def __init__(self, surface):
|
||||
|
||||
Reference in New Issue
Block a user