Skip to content

A sketch with multiple windows? #158

Answered by villares
villares asked this question in Q&A
Discussion options

You must be logged in to vote

So this is my silly example, for now...

from py5 import Sketch

class SketchySketch(Sketch):
    def __init__(self, title="", other=None):
        self.other = other
        self.title = title
        self.clicked = False
        super().__init__()        

    def settings(self):
        self.size(300, 200)

    def setup(self):
        self.window_resizable(True)
        if self.title:
            self.window_title(self.title)
        if self.other:
            self.other.other = self

    def draw(self):
        if self.title == 'A':
            self.background(255)
            self.fill(0)
        else:
            self.background(0)
            self.fill(255)
        self.rect(self.m…

Replies: 3 comments 19 replies

Comment options

villares
Sep 5, 2022
Collaborator Author

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@villares
Comment options

villares Sep 5, 2022
Collaborator Author

@villares
Comment options

villares Sep 5, 2022
Collaborator Author

@hx2A
Comment options

hx2A Sep 5, 2022
Maintainer

@villares
Comment options

villares Sep 5, 2022
Collaborator Author

@hx2A
Comment options

hx2A Sep 6, 2022
Maintainer

Comment options

villares
Sep 6, 2022
Collaborator Author

You must be logged in to vote
12 replies
@villares
Comment options

villares Sep 6, 2022
Collaborator Author

@bluekamandy
Comment options

@hx2A
Comment options

hx2A Sep 6, 2022
Maintainer

@bluekamandy
Comment options

@hx2A
Comment options

hx2A Sep 6, 2022
Maintainer

Answer selected by villares
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants