unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Looping through sequence of buttons and labels
@ 2024-07-02 23:19 Heime
  2024-07-03  4:13 ` CToID
  2024-07-03  4:15 ` CToID
  0 siblings, 2 replies; 5+ messages in thread
From: Heime @ 2024-07-02 23:19 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

This function prints a line with two buttons.  I would like to extend this so that
I can have N rows, rather than just a single row as done here.


(defun mondu (monbf funcs labels)
  "Insert buttons in buffer MONBF, using FUNCS for button actions
with LABELS as button labels."

  (with-current-buffer (get-buffer-create monbf)
    (insert " DU \n\n")
    (insert " ")

    (insert-button "[-]" 'action (nth 0 funcs))
    (insert (format " %s  " (nth 0 labels)))

    (insert-button "[-]" 'action (nth 1 funcs))
    (insert (format " %s  " (nth 1 labels))))

  (pop-to-buffer monbf))




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-07-03 19:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-02 23:19 Looping through sequence of buttons and labels Heime
2024-07-03  4:13 ` CToID
2024-07-03  4:15 ` CToID
2024-07-03  8:10   ` Heime
2024-07-03 19:24   ` Stefan Monnier via Users list for the GNU Emacs text editor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).