-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #383 from enthought/feature/enable_demo_runner
Demo runner for enable
- Loading branch information
Showing
34 changed files
with
661 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ------------------------------------------------------------------------- | ||
# | ||
# (C) Copyright 2019-2020 Enthought, Inc., Austin, TX | ||
# All rights reserved. | ||
# | ||
# This software is provided without warranty under the terms of the BSD | ||
# license included in enthought/LICENSE.txt and may be redistributed only | ||
# under the conditions described in the aforementioned license. The license | ||
# is also available online at http://www.enthought.com/licenses/BSD.txt | ||
# | ||
# Thanks for using Enthought open source! | ||
# | ||
# Author: David C. Morrill | ||
# Date: 09/15/2005 | ||
# | ||
# ------------------------------------------------------------------------- | ||
|
||
""" Run the Traits UI demo. | ||
""" | ||
|
||
from __future__ import absolute_import | ||
|
||
from traitsui.extras.demo import demo | ||
|
||
demo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
from enable.api import Canvas, Viewport, Window | ||
from enable.tools.api import ViewportPanTool | ||
from enable.api import Canvas, Viewport | ||
from enable.example_support import demo_main, DemoFrame | ||
from enable.tools.api import ViewportPanTool | ||
|
||
|
||
class MyFrame(DemoFrame): | ||
|
||
def _create_window(self): | ||
class Demo(DemoFrame): | ||
|
||
def create_component(self): | ||
canvas = Canvas(bgcolor="lightsteelblue", draw_axes=True) | ||
from basic_move import Box | ||
box = Box(color="red", bounds=[50, 50], resizable="") | ||
box.position= [75, 75] | ||
box.position = [75, 75] | ||
canvas.add(box) | ||
|
||
|
||
viewport = Viewport(component=canvas) | ||
viewport.view_position = [0, 0] | ||
viewport.tools.append(ViewportPanTool(viewport)) | ||
return viewport | ||
|
||
return Window(self, -1, component=viewport) | ||
|
||
|
||
if __name__ == "__main__": | ||
# Save demo so that it doesn't get garbage collected when run within | ||
# existing event loop (i.e. from ipython). | ||
demo = demo_main(MyFrame, title="Canvas example") | ||
demo = demo_main(Demo, title="Canvas example") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.