Skip to content

Mutability? #2

@jackfirth

Description

@jackfirth

Can a pict snip redraw itself when the pict field changes? I tried this, but it didn't work:

(define example-snip (new pict-snip% [pict first-pict]))

example-snip

(thread
 (λ ()
   (sleep 3)
   (set-field! pict example-snip second-pict)))

The first pict shows up in the DrRacket REPL as a snip, but it never changes to the second pict. My guess is that pict-snip% has no way to respond to a field mutation by telling its administrator that it's been resized. Maybe a set-pict method would work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions