@leif can you explain this program to me? I don’t know why (eval 'vl-append pict-namespace)
is raising an error. http://pasterack.org/pastes/92108
^ I mean, “why is ((eval 'vl-append pict-namespace) (blank 0 0))
raising an error”
@ben how did you constuct pict-namespace?
Because if it’s a different namespace, the runtime could be thinking they are two different struct types.
make-base-namespace
… (namespace-require 'pict)
; it is a different namespace
@ben Ya, that is just because its a different namespace (and has nothing to do with pict.)
For example, if you add: (define-namespace-anchor anchor)
(define pict-namespace2
(namespace-anchor->namespace anchor))
and use pict-namespace2
instead, it works out fine.
@ben @leif If the goal of pict-namespace
is to isolate effects, then it’s better to use namespace-attach-module
to attach pict
to the new namespace. But maybe the just-pushed improvement to namespace-attach-module
docs means that you’ already know that.
@mflatt Yup, exactly.
@ben and I (and Michael B.) figured that out, thanks though. :slightly_smiling_face:
well we should post the solution
@ben We did, by updating the docs. But in your case just adding a namespace-attach-module
works.
Speaking of nothing….I just found out that if you have:
A) A slider,
B) A timer that updates the slider on a regular interval, and
C) Click and drag the slider,
then every time the timer goes off while you are still holding the slider gets treated as if it was a click, rather than being set via set-value!
Not sure if that’s a bug or an intended feature. Thoughts @mflatt?
(“short” way to eval a string to a function from your favorite library)
Such as in this example: https://gist.github.com/LeifAndersen/ff07cb0ffd516b0333f2753db6e96c37
If you click and drag the slider around, the first callback will be what you want, but then you get a bunch of others that are not what you wanted.
Namely, you will get exactly how many as the amount the timer went off.
@jforrest888 has joined the channel
@leif that’s a bug
@mflatt Okay. I’ll try to hunt it down unless you beat me to it.
I haven’t investigated, but I think I know the problem: dragging puts the control in a “slider-value update means that a the slider was moved” mode, and calling set-value
doesn’t temporarily suppress that mode while updating the value
@mflatt I agree that sounds like the bug. Its more a matter of digging in and finding it. :wink:
Mostly because the implementation for the functions is: (bounce
c
(get-value)
(set-value v))
Which I am sure is great for code re-use, means I need to track down the actual get-value
without the help of DrRacket’s arrows.
(which, to be clear, is absolutely fine with me. :slightly_smiling_face: )
I expected to see the problem in “gui-lib/mred/private/wx/cocoa/slider.rkt”, but I don’t see anything there to control when 'slider
events are generated, so maybe my guess is wrong
Ya, about all I see is: (define/public (changed)
(callback this (new control-event%
[event-type 'slider]
[time-stamp (current-milliseconds)])))
Ah, this looks promising: (define-objc-class RacketSlider NSSlider
#:mixins (FocusResponder KeyMouseResponder CursorDisplayer)
[wxb]
(-a _void (changed: [_id sender])
(let ([wx (->wx wxb)])
(when wx
(send wx update-message)
(queue-window-event wx (lambda () (send wx changed)))
(constrained-reply
(send wx get-eventspace)
(lambda () (let loop () (pre-event-sync #t) (when (yield/no-sync) (loop))))
(void))))))
And the queue-window-event
would explain why you see all of the calls right after you let go.
I’m getting WARNING: bad 'scribblings info: '(("long//path/to/docs/main.scrbl"))
- do scribble document modules for a collection have to only be one folder down from the collection? Do I have to make a second info.rkt
module next to my scribble document with just scribblings
defined?
nevermind, turned out to be a problem with the categories
part of the scribblings info