Skip to content

Commit 88a7fa5

Browse files
authored
BUTTONS - Correctly wait for edit of button to complete before updating (#2207)
Fix editing of button...correctly wait for edit to complete before updating the button itself. Add (FIND-BUTTON label) function. Minor updates to documentation.
1 parent 63d5849 commit 88a7fa5

File tree

3 files changed

+30
-22
lines changed

3 files changed

+30
-22
lines changed

lispusers/BUTTONS

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10)
22

3-
(FILECREATED "18-Mar-2024 19:08:55" {LU}BUTTONS.;2 30183
3+
(FILECREATED " 7-Jul-2025 15:53:15" {DSK}<home>matt>Interlisp>medley>lispusers>BUTTONS.;3 30683
44

55
:EDIT-BY "mth"
66

7-
:CHANGES-TO (FNS \BUTTONS-EDITE)
7+
:CHANGES-TO (VARS BUTTONSCOMS)
8+
(FNS FIND-BUTTON)
89

9-
:PREVIOUS-DATE "26-Oct-89 14:30:27" {LU}BUTTONS.;1)
10+
:PREVIOUS-DATE " 6-Jul-2025 00:29:46" {DSK}<home>matt>Interlisp>medley>lispusers>BUTTONS.;2)
1011

1112

1213
(* ; "
13-
Copyright (c) 1986-1989, 2024 by Xerox Corporation.
14+
Copyright (c) 1986-1989, 2024-2025 by Xerox Corporation.
1415
")
1516

1617
(PRETTYCOMPRINT BUTTONSCOMS)
@@ -27,7 +28,7 @@ Copyright (c) 1986-1989, 2024 by Xerox Corporation.
2728
(RECORDS BUTTON)
2829
(FNS ALIGN-BUTTONS BUTTONP BUTTONSPROP BUTTON-ACTION BUTTON-LABEL CLOSE-BUTTON CLOSE-BUTTONS
2930
COPY-BUTTON CREATE-BUTTON DELETE-BUTTON DELETE-BUTTONS EDIT-BUTTON EDIT-BUTTON-CONTENTS
30-
EXECUTE-BUTTON EXPOSE-BUTTONS LOAD-SOME-BUTTONS MOVE-BUTTON REDISPLAY-BUTTON
31+
EXECUTE-BUTTON EXPOSE-BUTTONS FIND-BUTTON LOAD-SOME-BUTTONS MOVE-BUTTON REDISPLAY-BUTTON
3132
RESTORE-BUTTONS SAVE-BUTTONS SAVE-SOME-BUTTONS)
3233
(PROP ARGNAMES BUTTONSPROP BUTTON-ACTION BUTTON-LABEL)
3334

@@ -151,6 +152,11 @@ Copyright (c) 1986-1989, 2024 by Xerox Corporation.
151152
(LAMBDA (BUTTONS) (* Koomen "18-Mar-87 16:31") (DECLARE (GLOBALVARS *ALL-BUTTONS*)) (for BUTTON in (OR (LISTP BUTTONS) *ALL-BUTTONS*) do (REDISPLAY-BUTTON BUTTON)))
152153
)
153154

155+
(FIND-BUTTON
156+
[LAMBDA (LABEL)
157+
(DECLARE (GLOBALVARS *ALL-BUTTONS*)) (* ; "Edited 5-Jul-2025 17:37 by mth")
158+
(for B in *ALL-BUTTONS* thereis (EQUAL LABEL (WINDOWPROP B 'BUTTON-LABEL])
159+
154160
(LOAD-SOME-BUTTONS
155161
(LAMBDA (FILENAME) (* Koomen " 2-Dec-88 15:02") (if (BUTTONP FILENAME) then (* ;; "Invoked from button menu") (SETQ FILENAME NIL)) (if (NULL FILENAME) then (SETQ FILENAME (\BUTTONS-PROMPT-FOR-DATAFILE-NAME "File to load buttons from (NIL to abort):"))) (if FILENAME then (RESTORE-BUTTONS FILENAME (QUOTE ASK))))
156162
)
@@ -245,10 +251,11 @@ Copyright (c) 1986-1989, 2024 by Xerox Corporation.
245251
)
246252

247253
(\BUTTONS-EDITE
248-
[LAMBDA (FORM) (* ; "Edited 18-Mar-2024 18:19 by mth")
254+
[LAMBDA (FORM) (* ; "Edited 6-Jul-2025 00:24 by mth")
255+
(* ; "Edited 18-Mar-2024 18:19 by mth")
249256
(* edited%: "18-Mar-87 22:39")
250257
(ALLOW.BUTTON.EVENTS)
251-
(EVAL.AS.PROCESS `[CAR (NLSETQ (EDITE ,(KWOTE FORM]
258+
(PROCESS.RESULT [EVAL.AS.PROCESS `(CAR (NLSETQ (EDITE ,(KWOTE FORM]
252259
T])
253260

254261
(\BUTTONS-EDIT-MENU
@@ -344,20 +351,21 @@ Copyright (c) 1986-1989, 2024 by Xerox Corporation.
344351

345352
(ADDTOVAR LAMA BUTTON-LABEL BUTTON-ACTION BUTTONSPROP)
346353
)
347-
(PUTPROPS BUTTONS COPYRIGHT ("Xerox Corporation" 1986 1987 1988 1989 2024))
354+
(PUTPROPS BUTTONS COPYRIGHT ("Xerox Corporation" 1986 1987 1988 1989 2024 2025))
348355
(DECLARE%: DONTCOPY
349-
(FILEMAP (NIL (4365 15400 (ALIGN-BUTTONS 4375 . 5150) (BUTTONP 5152 . 5357) (BUTTONSPROP 5359 . 5904)
350-
(BUTTON-ACTION 5906 . 6270) (BUTTON-LABEL 6272 . 6681) (CLOSE-BUTTON 6683 . 6793) (CLOSE-BUTTONS 6795
351-
. 6976) (COPY-BUTTON 6978 . 7199) (CREATE-BUTTON 7201 . 8610) (DELETE-BUTTON 8612 . 8813) (
352-
DELETE-BUTTONS 8815 . 9009) (EDIT-BUTTON 9011 . 9746) (EDIT-BUTTON-CONTENTS 9748 . 10380) (
353-
EXECUTE-BUTTON 10382 . 10798) (EXPOSE-BUTTONS 10800 . 10986) (LOAD-SOME-BUTTONS 10988 . 11324) (
354-
MOVE-BUTTON 11326 . 12289) (REDISPLAY-BUTTON 12291 . 12551) (RESTORE-BUTTONS 12553 . 13382) (
355-
SAVE-BUTTONS 13384 . 14132) (SAVE-SOME-BUTTONS 14134 . 15398)) (16568 26849 (\BUTTONS-BUTTONEVENTFN
356-
16578 . 16961) (\BUTTONS-DATAFILE-NAME 16963 . 17659) (\BUTTONS-CHANGE-LABEL 17661 . 17918) (
357-
\BUTTONS-CREATE-ICON 17920 . 18807) (\BUTTONS-DRAW-BOX 18809 . 18983) (\BUTTONS-EDITE 18985 . 19306) (
358-
\BUTTONS-EDIT-MENU 19308 . 20925) (\BUTTONS-INIT 20927 . 21175) (\BUTTONS-IO-EXIT 21177 . 21403) (
359-
\BUTTONS-OPEN-STREAM 21405 . 21836) (\BUTTONS-PROMPT-FOR-DATAFILE-NAME 21838 . 22191) (\BUTTONS-READ
360-
22193 . 23547) (\BUTTONS-SETPROP 23549 . 24479) (\BUTTONS-SHOW 24481 . 24859) (\BUTTONS-SHOW-EXEC
361-
24861 . 25228) (\BUTTONS-TRACK-MOUSE 25230 . 26504) (\BUTTONS-WAIT-MOUSE 26506 . 26847)) (26929 28428
362-
(DROPSHADOW 26939 . 27838) (ICONMASK 27840 . 28053) (CLEAR-MASK-OUTLINE 28055 . 28426)))))
356+
(FILEMAP (NIL (4495 15770 (ALIGN-BUTTONS 4505 . 5280) (BUTTONP 5282 . 5487) (BUTTONSPROP 5489 . 6034)
357+
(BUTTON-ACTION 6036 . 6400) (BUTTON-LABEL 6402 . 6811) (CLOSE-BUTTON 6813 . 6923) (CLOSE-BUTTONS 6925
358+
. 7106) (COPY-BUTTON 7108 . 7329) (CREATE-BUTTON 7331 . 8740) (DELETE-BUTTON 8742 . 8943) (
359+
DELETE-BUTTONS 8945 . 9139) (EDIT-BUTTON 9141 . 9876) (EDIT-BUTTON-CONTENTS 9878 . 10510) (
360+
EXECUTE-BUTTON 10512 . 10928) (EXPOSE-BUTTONS 10930 . 11116) (FIND-BUTTON 11118 . 11356) (
361+
LOAD-SOME-BUTTONS 11358 . 11694) (MOVE-BUTTON 11696 . 12659) (REDISPLAY-BUTTON 12661 . 12921) (
362+
RESTORE-BUTTONS 12923 . 13752) (SAVE-BUTTONS 13754 . 14502) (SAVE-SOME-BUTTONS 14504 . 15768)) (16938
363+
27344 (\BUTTONS-BUTTONEVENTFN 16948 . 17331) (\BUTTONS-DATAFILE-NAME 17333 . 18029) (
364+
\BUTTONS-CHANGE-LABEL 18031 . 18288) (\BUTTONS-CREATE-ICON 18290 . 19177) (\BUTTONS-DRAW-BOX 19179 .
365+
19353) (\BUTTONS-EDITE 19355 . 19801) (\BUTTONS-EDIT-MENU 19803 . 21420) (\BUTTONS-INIT 21422 . 21670)
366+
(\BUTTONS-IO-EXIT 21672 . 21898) (\BUTTONS-OPEN-STREAM 21900 . 22331) (
367+
\BUTTONS-PROMPT-FOR-DATAFILE-NAME 22333 . 22686) (\BUTTONS-READ 22688 . 24042) (\BUTTONS-SETPROP 24044
368+
. 24974) (\BUTTONS-SHOW 24976 . 25354) (\BUTTONS-SHOW-EXEC 25356 . 25723) (\BUTTONS-TRACK-MOUSE 25725
369+
. 26999) (\BUTTONS-WAIT-MOUSE 27001 . 27342)) (27424 28923 (DROPSHADOW 27434 . 28333) (ICONMASK 28335
370+
. 28548) (CLEAR-MASK-OUTLINE 28550 . 28921)))))
363371
STOP

lispusers/BUTTONS.LCOM

316 Bytes
Binary file not shown.

lispusers/BUTTONS.TEDIT

691 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)