all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.