
@capfredf has joined the channel

i’m reading bout the graphics manipulation tutorials from https://alex-hhh.github.io/2020/06/ishido.html. A quick one: are snips objects that have drag-and-drop properties ?

Yes and no. A pasteboard editor (pasteboard%
) contains items that are draggable. It can contain snips.

ok,

Look at Alex’s three blog posts on the chess board: https://alex-hhh.github.io/2018/10/chess-game-using-racket-s-pasteboard.html

i’ve opened it too, planning to read it after this one :slightly_smiling_face:

Best place to learn about the gui library.

apart from his posts, are there other sources ?


i have been reading that as well


is this different from the GUI or it’s a subset of this ?

I think of the Framework as “extras”. It’s the first place I look, when I can’t find something in gui
.

Btw Felleisen has implemented the 7 challenges from 7GUI: https://github.com/mfelleisen/7GUI
See https://eugenkiss.github.io/7guis/ for an explanation.

ok

what library do you suggest to draw a rectangle, and arrows? trying to build graph applications with edges and vertex which which will also contains some visible properties on their own

Not sure. For static images, I’d use metapict - but I am biased :slightly_smiling_face:

If you have a canvas, you can get the drawing context with get-dc
.

You can then use the operations here: https://docs.racket-lang.org/draw/dc___.html#%28meth._%28%28%28lib._racket%2Fdraw..rkt%29._dc~3c~25~3e%29._draw-arc%29%29

ok

can you please explain further the role of the snip class? i’m still confused about it

In pasteboard or in text editor?

in pasteboard

ok, I won’t be able to answer that. Have never used pasteboard.

ok, what about in text editor ?

It’s pretty much the basic element that can be shown in a text editor. For example, take a look at https://docs.racket-lang.org/rosette-guide/sec_utility-libs.html?q=rosette%2Flib%2Fvalue-browser#%28part._.Examples%29

If a value evaluates to a snip, DrRacket will recognize it and display it in a fancy way

as opposed to other values

so in this case, a snip is a virtual measurement unit?

I’m not familiar with “measurement unit”. What do you mean by that?

i mean an object with default size. nvm, i’m referring to pasteboard :slightly_smiling_face:



ok


the example code in the last link is rely helpful imo

thanks

so, by default all snips are draggable, right ?

on an editor canvas

?

sorry I meant pasteboard%

ok

you have to do some code if you want to drag beyond the limits of a pasteboard

well, i m trying to test some rectangle to draw and drag which will be used to build diagrams later

arrows might be useful - depending on the type of diagram you are drawing: https://docs.racket-lang.org/draw/Drawing_Conveniences.html?q=arrow#%28part._.Arrows%29

and this example of a gui app (sans pasteboard) might be an informative example https://gist.github.com/Metaxal/0f928d1b429aa36b8c6046a77c994973

ok

is this part of gui or independent ?

ok, i’ve gotten few hints, let me read more

sorry I’ve been terse today - just concentrating on something else. Please come back if you have questions.

ok, thanks