-
Notifications
You must be signed in to change notification settings - Fork 45
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 #94 from enthought/fix-examples
Fix examples on Qt and interactive session
- Loading branch information
Showing
25 changed files
with
252 additions
and
314 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
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,26 +1,27 @@ | ||
|
||
|
||
from enable.api import Canvas, Viewport, Window | ||
from enable.tools.api import ViewportPanTool | ||
from enable.primitives.api import Box | ||
from enable.example_support import demo_main, DemoFrame | ||
|
||
|
||
class MyFrame(DemoFrame): | ||
|
||
def _create_window(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 = Box(color="red", bounds=[50, 50], resizable="") | ||
box.position= [75, 75] | ||
canvas.add(box) | ||
|
||
|
||
viewport = Viewport(component=canvas) | ||
viewport.view_position = [0,0] | ||
viewport.view_position = [0, 0] | ||
viewport.tools.append(ViewportPanTool(viewport)) | ||
|
||
return Window(self, -1, component=viewport) | ||
|
||
|
||
if __name__ == "__main__": | ||
demo_main(MyFrame, title="Canvas example") | ||
# 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") |
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.