pep8 compliance: E302 expected 2 blank lines
This commit is contained in:
parent
422264e81d
commit
623dcf524d
@ -10,6 +10,7 @@ import resource
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Control(object):
|
class Control(object):
|
||||||
|
|
||||||
highlighted = overridable_property('highlighted')
|
highlighted = overridable_property('highlighted')
|
||||||
@ -52,6 +53,7 @@ class Control(object):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class AttrRef(object):
|
class AttrRef(object):
|
||||||
|
|
||||||
def __init__(self, obj, attr):
|
def __init__(self, obj, attr):
|
||||||
@ -66,6 +68,7 @@ class AttrRef(object):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class ItemRef(object):
|
class ItemRef(object):
|
||||||
|
|
||||||
def __init__(self, obj, item):
|
def __init__(self, obj, item):
|
||||||
@ -80,6 +83,7 @@ class ItemRef(object):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Label(Widget):
|
class Label(Widget):
|
||||||
|
|
||||||
text = overridable_property('text')
|
text = overridable_property('text')
|
||||||
@ -180,13 +184,17 @@ class Label(Widget):
|
|||||||
surface.blit(image, r)
|
surface.blit(image, r)
|
||||||
y += dy
|
y += dy
|
||||||
|
|
||||||
|
|
||||||
class GLLabel(Label):
|
class GLLabel(Label):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class SmallLabel(Label):
|
class SmallLabel(Label):
|
||||||
"""Small text size. See theme.py"""
|
"""Small text size. See theme.py"""
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class ButtonBase(Control):
|
class ButtonBase(Control):
|
||||||
|
|
||||||
align = 'c'
|
align = 'c'
|
||||||
@ -213,6 +221,7 @@ class ButtonBase(Control):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Button(ButtonBase, Label):
|
class Button(ButtonBase, Label):
|
||||||
|
|
||||||
def __init__(self, text, action=None, enable=None, **kwds):
|
def __init__(self, text, action=None, enable=None, **kwds):
|
||||||
@ -224,6 +233,7 @@ class Button(ButtonBase, Label):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Image(Widget):
|
class Image(Widget):
|
||||||
# image Image to display
|
# image Image to display
|
||||||
|
|
||||||
@ -264,11 +274,13 @@ class Image(Widget):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class ImageButton(ButtonBase, Image):
|
class ImageButton(ButtonBase, Image):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class ValueDisplay(Control, Label):
|
class ValueDisplay(Control, Label):
|
||||||
|
|
||||||
format = "%s"
|
format = "%s"
|
||||||
@ -294,8 +306,10 @@ class ValueDisplay(Control, Label):
|
|||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
class SmallValueDisplay(ValueDisplay): pass
|
class SmallValueDisplay(ValueDisplay): pass
|
||||||
|
|
||||||
|
|
||||||
class ValueButton(ButtonBase, ValueDisplay):
|
class ValueButton(ButtonBase, ValueDisplay):
|
||||||
|
|
||||||
align = 'c'
|
align = 'c'
|
||||||
@ -304,6 +318,7 @@ class ValueButton(ButtonBase, ValueDisplay):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class CheckControl(Control):
|
class CheckControl(Control):
|
||||||
|
|
||||||
def mouse_down(self, e):
|
def mouse_down(self, e):
|
||||||
@ -314,6 +329,7 @@ class CheckControl(Control):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class CheckWidget(Widget):
|
class CheckWidget(Widget):
|
||||||
|
|
||||||
default_size = (16, 16)
|
default_size = (16, 16)
|
||||||
@ -341,11 +357,13 @@ class CheckWidget(Widget):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class CheckBox(CheckControl, CheckWidget):
|
class CheckBox(CheckControl, CheckWidget):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class RadioControl(Control):
|
class RadioControl(Control):
|
||||||
|
|
||||||
setting = None
|
setting = None
|
||||||
@ -358,5 +376,6 @@ class RadioControl(Control):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class RadioButton(RadioControl, CheckWidget):
|
class RadioButton(RadioControl, CheckWidget):
|
||||||
pass
|
pass
|
||||||
|
@ -6,6 +6,7 @@ from controls import Label, Button
|
|||||||
from layout import Row, Column
|
from layout import Row, Column
|
||||||
from fields import TextField
|
from fields import TextField
|
||||||
|
|
||||||
|
|
||||||
class Modal(object):
|
class Modal(object):
|
||||||
|
|
||||||
enter_response = True
|
enter_response = True
|
||||||
@ -58,6 +59,7 @@ class Dialog(Modal, Widget):
|
|||||||
if response is not None:
|
if response is not None:
|
||||||
self.dismiss(response)
|
self.dismiss(response)
|
||||||
|
|
||||||
|
|
||||||
class QuickDialog(Dialog):
|
class QuickDialog(Dialog):
|
||||||
""" Dialog that closes as soon as you click outside or press a key"""
|
""" Dialog that closes as soon as you click outside or press a key"""
|
||||||
def mouse_down(self, evt):
|
def mouse_down(self, evt):
|
||||||
@ -70,6 +72,7 @@ class QuickDialog(Dialog):
|
|||||||
self.dismiss()
|
self.dismiss()
|
||||||
event.post(evt)
|
event.post(evt)
|
||||||
|
|
||||||
|
|
||||||
def wrapped_label(text, wrap_width, **kwds):
|
def wrapped_label(text, wrap_width, **kwds):
|
||||||
paras = text.split("\n")
|
paras = text.split("\n")
|
||||||
text = "\n".join([textwrap.fill(para, wrap_width) for para in paras])
|
text = "\n".join([textwrap.fill(para, wrap_width) for para in paras])
|
||||||
@ -84,9 +87,11 @@ def wrapped_label(text, wrap_width, **kwds):
|
|||||||
# box.shrink_wrap()
|
# box.shrink_wrap()
|
||||||
# return box.present()
|
# return box.present()
|
||||||
|
|
||||||
|
|
||||||
def alert(mess, **kwds):
|
def alert(mess, **kwds):
|
||||||
ask(mess, ["OK"], **kwds)
|
ask(mess, ["OK"], **kwds)
|
||||||
|
|
||||||
|
|
||||||
def ask(mess, responses = ["OK", "Cancel"], default = 0, cancel = -1,
|
def ask(mess, responses = ["OK", "Cancel"], default = 0, cancel = -1,
|
||||||
wrap_width = 60, **kwds):
|
wrap_width = 60, **kwds):
|
||||||
box = Dialog(**kwds)
|
box = Dialog(**kwds)
|
||||||
@ -114,6 +119,7 @@ def ask(mess, responses = ["OK", "Cancel"], default = 0, cancel = -1,
|
|||||||
box.shrink_wrap()
|
box.shrink_wrap()
|
||||||
return box.present()
|
return box.present()
|
||||||
|
|
||||||
|
|
||||||
def input_text(prompt, width, initial = None, **kwds):
|
def input_text(prompt, width, initial = None, **kwds):
|
||||||
box = Dialog(**kwds)
|
box = Dialog(**kwds)
|
||||||
d = box.margin
|
d = box.margin
|
||||||
|
@ -10,6 +10,7 @@ from controls import Control
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class TextEditor(Widget):
|
class TextEditor(Widget):
|
||||||
|
|
||||||
upper = False
|
upper = False
|
||||||
@ -179,6 +180,7 @@ class TextEditor(Widget):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Field(Control, TextEditor):
|
class Field(Control, TextEditor):
|
||||||
# type func(string) -> value
|
# type func(string) -> value
|
||||||
# editing boolean
|
# editing boolean
|
||||||
@ -288,10 +290,12 @@ class Field(Control, TextEditor):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class TextField(Field):
|
class TextField(Field):
|
||||||
type = unicode
|
type = unicode
|
||||||
_value = u""
|
_value = u""
|
||||||
|
|
||||||
|
|
||||||
class IntField(Field):
|
class IntField(Field):
|
||||||
tooltipText = "Point here and use mousewheel to adjust"
|
tooltipText = "Point here and use mousewheel to adjust"
|
||||||
def type(self, i):
|
def type(self, i):
|
||||||
@ -408,6 +412,7 @@ class TimeField(Field):
|
|||||||
from pygame import key
|
from pygame import key
|
||||||
from pygame.locals import KMOD_SHIFT
|
from pygame.locals import KMOD_SHIFT
|
||||||
|
|
||||||
|
|
||||||
class FloatField(Field):
|
class FloatField(Field):
|
||||||
type = float
|
type = float
|
||||||
_increment = 1.0
|
_increment = 1.0
|
||||||
|
@ -14,6 +14,7 @@ from albow.layout import Row, Column
|
|||||||
from albow.palette_view import PaletteView
|
from albow.palette_view import PaletteView
|
||||||
from albow.theme import ThemeProperty
|
from albow.theme import ThemeProperty
|
||||||
|
|
||||||
|
|
||||||
class DirPathView(Widget):
|
class DirPathView(Widget):
|
||||||
|
|
||||||
def __init__(self, width, client, **kwds):
|
def __init__(self, width, client, **kwds):
|
||||||
@ -311,6 +312,7 @@ def request_new_filename(prompt = None, suffix = None, extra_suffixes = None,
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def request_old_filename(suffixes = None, directory = None):
|
def request_old_filename(suffixes = None, directory = None):
|
||||||
dlog = FileOpenDialog(suffixes = suffixes)
|
dlog = FileOpenDialog(suffixes = suffixes)
|
||||||
if directory:
|
if directory:
|
||||||
@ -320,6 +322,7 @@ def request_old_filename(suffixes = None, directory = None):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def look_for_file_or_directory(target, prompt = None, directory = None):
|
def look_for_file_or_directory(target, prompt = None, directory = None):
|
||||||
dlog = LookForFileDialog(target = target, prompt = prompt)
|
dlog = LookForFileDialog(target = target, prompt = prompt)
|
||||||
if directory:
|
if directory:
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from pygame import Rect
|
from pygame import Rect
|
||||||
from widget import Widget
|
from widget import Widget
|
||||||
|
|
||||||
|
|
||||||
class GridView(Widget):
|
class GridView(Widget):
|
||||||
# cell_size (width, height) size of each cell
|
# cell_size (width, height) size of each cell
|
||||||
#
|
#
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from pygame import Rect
|
from pygame import Rect
|
||||||
from albow.resource import get_image
|
from albow.resource import get_image
|
||||||
|
|
||||||
|
|
||||||
class ImageArray(object):
|
class ImageArray(object):
|
||||||
|
|
||||||
def __init__(self, image, shape):
|
def __init__(self, image, shape):
|
||||||
@ -41,6 +42,7 @@ class ImageArray(object):
|
|||||||
|
|
||||||
image_array_cache = {}
|
image_array_cache = {}
|
||||||
|
|
||||||
|
|
||||||
def get_image_array(name, shape, **kwds):
|
def get_image_array(name, shape, **kwds):
|
||||||
result = image_array_cache.get(name)
|
result = image_array_cache.get(name)
|
||||||
if not result:
|
if not result:
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
from pygame import Rect
|
from pygame import Rect
|
||||||
from widget import Widget
|
from widget import Widget
|
||||||
|
|
||||||
|
|
||||||
class RowOrColumn(Widget):
|
class RowOrColumn(Widget):
|
||||||
|
|
||||||
_is_gl_container = True
|
_is_gl_container = True
|
||||||
@ -63,6 +64,7 @@ class RowOrColumn(Widget):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Row(RowOrColumn):
|
class Row(RowOrColumn):
|
||||||
|
|
||||||
d = (1, 0)
|
d = (1, 0)
|
||||||
@ -84,6 +86,7 @@ class Row(RowOrColumn):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Column(RowOrColumn):
|
class Column(RowOrColumn):
|
||||||
|
|
||||||
d = (0, 1)
|
d = (0, 1)
|
||||||
@ -105,6 +108,7 @@ class Column(RowOrColumn):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Grid(Widget):
|
class Grid(Widget):
|
||||||
|
|
||||||
_is_gl_container = True
|
_is_gl_container = True
|
||||||
@ -140,6 +144,7 @@ class Grid(Widget):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Frame(Widget):
|
class Frame(Widget):
|
||||||
# margin int spacing between border and widget
|
# margin int spacing between border and widget
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ from theme import ThemeProperty
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class MenuItem(object):
|
class MenuItem(object):
|
||||||
|
|
||||||
keyname = ""
|
keyname = ""
|
||||||
@ -47,6 +48,7 @@ class MenuItem(object):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Menu(Dialog):
|
class Menu(Dialog):
|
||||||
|
|
||||||
disabled_color = ThemeProperty('disabled_color')
|
disabled_color = ThemeProperty('disabled_color')
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
from pygame import Rect
|
from pygame import Rect
|
||||||
from widget import Widget, overridable_property
|
from widget import Widget, overridable_property
|
||||||
|
|
||||||
|
|
||||||
class MenuBar(Widget):
|
class MenuBar(Widget):
|
||||||
|
|
||||||
menus = overridable_property('menus', "List of Menu instances")
|
menus = overridable_property('menus', "List of Menu instances")
|
||||||
|
@ -35,6 +35,7 @@ next_change_delay = 0
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class PlayList(object):
|
class PlayList(object):
|
||||||
"""A collection of music filenames to be played sequentially or
|
"""A collection of music filenames to be played sequentially or
|
||||||
randomly. If random is true, items will be played in a random order.
|
randomly. If random is true, items will be played in a random order.
|
||||||
@ -64,12 +65,14 @@ class PlayList(object):
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def get_music(*names, **kwds):
|
def get_music(*names, **kwds):
|
||||||
"""Return the full pathname of a music file from the "music" resource
|
"""Return the full pathname of a music file from the "music" resource
|
||||||
subdirectory."""
|
subdirectory."""
|
||||||
prefix = kwds.pop('prefix', "music")
|
prefix = kwds.pop('prefix', "music")
|
||||||
return resource_path(prefix, *names)
|
return resource_path(prefix, *names)
|
||||||
|
|
||||||
|
|
||||||
def get_playlist(*names, **kwds):
|
def get_playlist(*names, **kwds):
|
||||||
prefix = kwds.pop('prefix', "music")
|
prefix = kwds.pop('prefix', "music")
|
||||||
dirpath = get_music(*names, **{'prefix': prefix})
|
dirpath = get_music(*names, **{'prefix': prefix})
|
||||||
@ -79,6 +82,7 @@ def get_playlist(*names, **kwds):
|
|||||||
items.sort()
|
items.sort()
|
||||||
return PlayList(items, **kwds)
|
return PlayList(items, **kwds)
|
||||||
|
|
||||||
|
|
||||||
def change_playlist(new_playlist):
|
def change_playlist(new_playlist):
|
||||||
"""Fade out any currently playing music and start playing from the given
|
"""Fade out any currently playing music and start playing from the given
|
||||||
playlist."""
|
playlist."""
|
||||||
@ -93,6 +97,7 @@ def change_playlist(new_playlist):
|
|||||||
else:
|
else:
|
||||||
current_music = None
|
current_music = None
|
||||||
|
|
||||||
|
|
||||||
def change_music(new_music, repeat = False):
|
def change_music(new_music, repeat = False):
|
||||||
"""Fade out any currently playing music and start playing the given
|
"""Fade out any currently playing music and start playing the given
|
||||||
music file."""
|
music file."""
|
||||||
@ -104,16 +109,19 @@ def change_music(new_music, repeat = False):
|
|||||||
new_playlist = None
|
new_playlist = None
|
||||||
change_playlist(new_playlist)
|
change_playlist(new_playlist)
|
||||||
|
|
||||||
|
|
||||||
def music_end():
|
def music_end():
|
||||||
#print "albow.music: music_end" ###
|
#print "albow.music: music_end" ###
|
||||||
schedule(next_change_delay, jog_music)
|
schedule(next_change_delay, jog_music)
|
||||||
|
|
||||||
|
|
||||||
def jog_music():
|
def jog_music():
|
||||||
"""If no music is currently playing, start playing the next item
|
"""If no music is currently playing, start playing the next item
|
||||||
from the current playlist."""
|
from the current playlist."""
|
||||||
if music_enabled and not music.get_busy():
|
if music_enabled and not music.get_busy():
|
||||||
start_next_music()
|
start_next_music()
|
||||||
|
|
||||||
|
|
||||||
def start_next_music():
|
def start_next_music():
|
||||||
"""Start playing the next item from the current playlist immediately."""
|
"""Start playing the next item from the current playlist immediately."""
|
||||||
#print "albow.music: start_next_music" ###
|
#print "albow.music: start_next_music" ###
|
||||||
@ -127,9 +135,11 @@ def start_next_music():
|
|||||||
next_change_delay = change_delay
|
next_change_delay = change_delay
|
||||||
current_music = next_music
|
current_music = next_music
|
||||||
|
|
||||||
|
|
||||||
def get_music_enabled():
|
def get_music_enabled():
|
||||||
return music_enabled
|
return music_enabled
|
||||||
|
|
||||||
|
|
||||||
def set_music_enabled(state):
|
def set_music_enabled(state):
|
||||||
global music_enabled
|
global music_enabled
|
||||||
if music_enabled != state:
|
if music_enabled != state:
|
||||||
@ -157,6 +167,7 @@ from albow.controls import Label, Button, CheckBox
|
|||||||
from albow.layout import Row, Column, Grid
|
from albow.layout import Row, Column, Grid
|
||||||
from albow.dialogs import Dialog
|
from albow.dialogs import Dialog
|
||||||
|
|
||||||
|
|
||||||
class EnableMusicControl(CheckBox):
|
class EnableMusicControl(CheckBox):
|
||||||
|
|
||||||
def get_value(self):
|
def get_value(self):
|
||||||
@ -165,6 +176,7 @@ class EnableMusicControl(CheckBox):
|
|||||||
def set_value(self, x):
|
def set_value(self, x):
|
||||||
set_music_enabled(x)
|
set_music_enabled(x)
|
||||||
|
|
||||||
|
|
||||||
class MusicVolumeControl(Widget):
|
class MusicVolumeControl(Widget):
|
||||||
|
|
||||||
def __init__(self, **kwds):
|
def __init__(self, **kwds):
|
||||||
@ -185,6 +197,7 @@ class MusicVolumeControl(Widget):
|
|||||||
music.set_volume(x)
|
music.set_volume(x)
|
||||||
self.invalidate()
|
self.invalidate()
|
||||||
|
|
||||||
|
|
||||||
class MusicOptionsDialog(Dialog):
|
class MusicOptionsDialog(Dialog):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -201,6 +214,7 @@ class MusicOptionsDialog(Dialog):
|
|||||||
self.add(contents)
|
self.add(contents)
|
||||||
self.shrink_wrap()
|
self.shrink_wrap()
|
||||||
|
|
||||||
|
|
||||||
def show_music_options_dialog():
|
def show_music_options_dialog():
|
||||||
dlog = MusicOptionsDialog()
|
dlog = MusicOptionsDialog()
|
||||||
dlog.present()
|
dlog.present()
|
||||||
|
@ -8,6 +8,7 @@ from __future__ import division
|
|||||||
from OpenGL import GL, GLU
|
from OpenGL import GL, GLU
|
||||||
from widget import Widget
|
from widget import Widget
|
||||||
|
|
||||||
|
|
||||||
class GLViewport(Widget):
|
class GLViewport(Widget):
|
||||||
|
|
||||||
is_gl_container = True
|
is_gl_container = True
|
||||||
@ -66,6 +67,7 @@ import numpy
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class GLOrtho(GLViewport):
|
class GLOrtho(GLViewport):
|
||||||
|
|
||||||
def __init__(self, rect=None,
|
def __init__(self, rect=None,
|
||||||
@ -83,6 +85,7 @@ class GLOrtho(GLViewport):
|
|||||||
GL.glOrtho(self.xmin, self.xmax, self.ymin, self.ymax,
|
GL.glOrtho(self.xmin, self.xmax, self.ymin, self.ymax,
|
||||||
self.near, self.far)
|
self.near, self.far)
|
||||||
|
|
||||||
|
|
||||||
class GLPixelOrtho(GLOrtho):
|
class GLPixelOrtho(GLOrtho):
|
||||||
def __init__(self, rect=None, near= -1, far=1, **kwds):
|
def __init__(self, rect=None, near= -1, far=1, **kwds):
|
||||||
GLOrtho.__init__(self, rect, near, far, **kwds)
|
GLOrtho.__init__(self, rect, near, far, **kwds)
|
||||||
@ -94,6 +97,7 @@ class GLPixelOrtho(GLOrtho):
|
|||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class GLPerspective(GLViewport):
|
class GLPerspective(GLViewport):
|
||||||
|
|
||||||
def __init__(self, rect=None, fovy=20,
|
def __init__(self, rect=None, fovy=20,
|
||||||
|
@ -6,6 +6,7 @@ from widget import Widget
|
|||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
class Screen(Widget):
|
class Screen(Widget):
|
||||||
|
|
||||||
def __init__(self, shell, **kwds):
|
def __init__(self, shell, **kwds):
|
||||||
|
Reference in New Issue
Block a user