ben
2017-9-18 15:32:11

@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


ben
2017-9-18 15:32:40

^ I mean, “why is ((eval 'vl-append pict-namespace) (blank 0 0)) raising an error”


leif
2017-9-18 15:51:01

@ben how did you constuct pict-namespace?


leif
2017-9-18 15:51:49

Because if it’s a different namespace, the runtime could be thinking they are two different struct types.


ben
2017-9-18 15:53:41

make-base-namespace(namespace-require 'pict); it is a different namespace


leif
2017-9-18 16:41:40

@ben Ya, that is just because its a different namespace (and has nothing to do with pict.)


leif
2017-9-18 16:41:49

For example, if you add: (define-namespace-anchor anchor) (define pict-namespace2 (namespace-anchor->namespace anchor))


leif
2017-9-18 16:41:58

and use pict-namespace2 instead, it works out fine.


mflatt
2017-9-18 19:15:36

@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.


leif
2017-9-18 19:16:02

@mflatt Yup, exactly.


leif
2017-9-18 19:16:29

@ben and I (and Michael B.) figured that out, thanks though. :slightly_smiling_face:


ben
2017-9-18 19:16:48

well we should post the solution


leif
2017-9-18 19:17:42

@ben We did, by updating the docs. But in your case just adding a namespace-attach-module works.


leif
2017-9-18 19:17:59

Speaking of nothing….I just found out that if you have:


leif
2017-9-18 19:18:03

A) A slider,


leif
2017-9-18 19:18:16

B) A timer that updates the slider on a regular interval, and


leif
2017-9-18 19:18:25

C) Click and drag the slider,


leif
2017-9-18 19:19:02

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!


leif
2017-9-18 19:19:15

Not sure if that’s a bug or an intended feature. Thoughts @mflatt?


ben
2017-9-18 19:25:55

ben
2017-9-18 19:27:15

(“short” way to eval a string to a function from your favorite library)


leif
2017-9-18 19:27:23

leif
2017-9-18 19:27:24

leif
2017-9-18 19:28:09

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.


leif
2017-9-18 19:28:31

Namely, you will get exactly how many as the amount the timer went off.


jforrest888
2017-9-18 20:01:56

@jforrest888 has joined the channel


mflatt
2017-9-18 20:59:19

@leif that’s a bug


leif
2017-9-18 21:06:47

@mflatt Okay. I’ll try to hunt it down unless you beat me to it.


mflatt
2017-9-18 21:08:41

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


leif
2017-9-18 21:11:30

@mflatt I agree that sounds like the bug. Its more a matter of digging in and finding it. :wink:


leif
2017-9-18 21:12:52

Mostly because the implementation for the functions is: (bounce c (get-value) (set-value v))


leif
2017-9-18 21:13:25

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.


leif
2017-9-18 21:14:04

(which, to be clear, is absolutely fine with me. :slightly_smiling_face: )


mflatt
2017-9-18 21:22:00

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


leif
2017-9-18 21:25:35

Ya, about all I see is: (define/public (changed) (callback this (new control-event% [event-type 'slider] [time-stamp (current-milliseconds)])))


leif
2017-9-18 21:27:44

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))))))


leif
2017-9-18 21:28:18

And the queue-window-event would explain why you see all of the calls right after you let go.


notjack
2017-9-19 03:21:45

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?


notjack
2017-9-19 03:27:27

nevermind, turned out to be a problem with the categories part of the scribblings info