chris613
2020-1-17 14:48:45

is it reasonable to require parts of HTDP in “normal” programs ??


chris613
2020-1-17 14:49:18

shrink-tl seems like what i want so i can “force” loaded bitmaps to a known size


chris613
2020-1-17 14:50:24

(define dwane (make-object bitmap% (string->path "/Users/chrismatheson/Downloads/dwayne1.jpg"))) (new message% [parent image] [label dwane] [min-height 100] [min-width 100] [stretchable-width false] [stretchable-height false]) however this end up with the “full size” image, but i wanted it locked to a max of 100x100


chris613
2020-1-17 14:50:42

i thought by setting the stretchability to false it would do that


mark.warren
2020-1-17 14:58:16

@chris613 I’m just going to check the docs but I would have thought if you make the image non-stretchable it won’t ‘shrink to fit’. Just a guess, I’ll check the docs.


chris613
2020-1-17 14:59:26

yeah i suspected that might be the case, which i was looking into shrink-tl but the original was how i hoped things would work :wink:


chris613
2020-1-17 15:04:46

also (this one might be a little simpler)


chris613
2020-1-17 15:05:13

chris613
2020-1-17 15:05:42

but i dont understand how to actually set that callback to my own function when defining a panel%


mark.warren
2020-1-17 15:07:24

Hmm.. After a quick look, I’m not much clearer. I would say it would be better to scale the image to the correct size first.


chris613
2020-1-17 15:07:44

yeah, i think thats what ill have a go at next :slightly_smiling_face:


chris613
2020-1-17 15:09:27

this isnt a criticism, more of an observation …. quite a lot of the GUI components feel a bit batteries-not-included type thing. I assume the rationale is to ship primitives and let the ecosystem take care of the rest. Am i missing a nice library of batteries included GUI components


mark.warren
2020-1-17 15:13:31

MrLib provides more but may still be more basic than you want. I think the GUI toolkit is just that, a toolkit for building GUI components (but I could easily be wrong). I think it is sort of required that you extend the base components and customise as necessary. This I think is true when you want to do specific event handling.


chris613
2020-1-17 15:14:10

coolio. any poiinters on the file drop callback thing ?


mark.warren
2020-1-17 15:15:12

Sorry, not really my field. I don’t do a lot of GUI work, so my opinions are probably not too reliable.


chris613
2020-1-17 15:15:31

not at all, any and all help is very welcome :slightly_smiling_face:


soegaard2
2020-1-17 15:18:35

@chris613 It’s easy to overlook: https://docs.racket-lang.org/framework/index.html


mark.warren
2020-1-17 15:19:18

Although I think for the panel% situation you would have to subclass the panel% object and override the on-drop-file.


chris613
2020-1-17 15:19:33

ahhh


mark.warren
2020-1-17 15:20:21

Cool


chris613
2020-1-17 15:20:30

can i (set-field! on-drop-file (lambda () …)) ?


chris613
2020-1-17 15:20:39

off to try :wink: