Shooting a 2 part GUI tool making tutorial

15 views
Skip to first unread message

pixel...@gmail.com

unread,
Sep 9, 2025, 11:46:03 PMSep 9
to Medley Interlisp core
I'm making a little tutorial to introduce some topics and make a GUI tool over a 2(?) part video series. Feel free to comment with any corrections or misstatements!

https://www.youtube.com/watch?v=ps_N2WWwM-o

Paolo Amoroso

unread,
Sep 10, 2025, 2:23:53 AMSep 10
to pixel...@gmail.com, Medley Interlisp core
Thanks, I'll watch the video and add it to today's meeting agenda.


On Wed, Sep 10, 2025 at 5:46 AM pixel...@gmail.com <pixel...@gmail.com> wrote:
I'm making a little tutorial to introduce some topics and make a GUI tool over a 2(?) part video series. Feel free to comment with any corrections or misstatements!

https://www.youtube.com/watch?v=ps_N2WWwM-o

--
You received this message because you are subscribed to the Google Groups "Medley Interlisp core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lispcore+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/lispcore/fbc05f93-75b7-49f1-a64e-7bf09681826bn%40googlegroups.com.


--

pixel...@gmail.com

unread,
Sep 11, 2025, 5:47:59 PMSep 11
to Medley Interlisp core
Well, my test run of finishing the tool is mostly done. Essentially, I wanted to show people how easy it is to build a very small but semi-useful tool.
I wanted to make the tool before I did the second video.

But I'm left with some minor features I'd like to add.
I noticed that the WINDOWPROP functions seem to treat the window border itself as part of the window height.
I read that one may simply use the window itself as the graphics stream so I suppose that makes sense.

Question 1
What I'd really like to do is work in terms of the inner canvas geometry.
Are there any functions to work with geometry according to the inside geometry of the window?
I can, of course, do the necessary arithmetic taking borders into account if need be. 

Question 2
As you can see in the HARRY-PLOTTER window I cheated and used mostly positive coordinates.
I think it's technically correct but I'd really like to move the origin of drawing to the center.
This of course takes knowing the inner height and width. I could then generate a better range of numbers with negative indices.
I read that you can set the current position in the drawing stream but after fussing around a bit I didn't get it moved.

I will provide both functions I've created.

(CL:DEFUN GENPTS (&OPTIONAL (NUM-PTS 128))
  "MAKE A DUMMY LIST OF (X . Y) PAIRS FOR TESTING."
  (FOR I FROM 0 TO NUM-PTS
       COLLECT (CONS (RAND 0 100)
     (RAND 0 100))))

(CL:DEFUN HARRY-PLOTTER (XYPAIRS)
  "GIVEN A LIST OF (X . Y) PAIRS, PLOT THEM TO A NEW WINDOW."
  (LET ((W (CREATEW (CREATEREGION 128 128 256 256) "HARRY PLOTTER")))
    (CL:LOOP FOR (X . Y) IN XYPAIRS DO (DRAWPOINT X Y '(ROUND 3) W 'PAINT))
    W))


An image update:
Screenshot_20250911_151727.png

Paolo Amoroso

unread,
Sep 12, 2025, 4:53:36 AMSep 12
to pixel...@gmail.com, Medley Interlisp core
Thanks, I've shared your first video on our socials.

Here is my possibly incomplete and inaccurate understanding. Although it's sometimes handy to draw on a window, you usually do graphics on the abstract drawing space associated with the window, an image stream, and let scrolling handle making sure what's interesting is in view. To get the size of the clipping region, the part of the image stream visible through the window, you call DSPCLIPPINGREGION (DSP stands for display stream, a stream specialized for the display) with NIL as the first argument to report the region rather than setting it, and the window as the second which is coerced to the proper stream:

4_ (SETQ W (CREATEW (CREATEREGION 128 128 256 256) "Window 3.1"))
{WINDOW}#122,24000
5_ (DSPCLIPPINGREGION NIL W)
(0 0 248 235)



Paolo Amoroso

unread,
Sep 12, 2025, 5:49:14 AMSep 12
to pixel...@gmail.com, Medley Interlisp core
One more thing. For a less random and more dataset-like look you might plot the points at the values of a function (e.g. linear or polynomial) and add a random offset.

Message has been deleted

pixel...@gmail.com

unread,
Sep 12, 2025, 7:07:05 PMSep 12
to Medley Interlisp core
Ah ha! Thank you sir, this will be valuable.
That should solve my problem nicely.
Message has been deleted

pixel...@gmail.com

unread,
Sep 13, 2025, 1:33:17 AMSep 13
to Medley Interlisp core
I've finished the second video:
https://www.youtube.com/watch?v=1od2YqDBo-c

It will probably have a 3rd part since I ran out of time just before the file saving.

Paolo Amoroso

unread,
Sep 13, 2025, 5:09:17 AMSep 13
to pixel...@gmail.com, Medley Interlisp core
Nice conclusion. The infix notation is CLIPS (Conversational LISP), an Algol-like infix syntax designed to augment the traditional Lisp syntax rather than replace it like M-exps.


Reply all
Reply to author
Forward
0 new messages