Package: gtk

Function gtk:application-windows

Lambda List

gtk:application-windows (application)

Arguments

application -- a gtk:application instance

Return Value

The list of gtk:window widgets.

Details

Gets a list of the windows associated with the application. The list is sorted by most recently focused windows, such that the first element is the currently focused window. This is useful for choosing a parent for a transient window.

Examples

This code from the GTK Demo defines a "quit" action. The signal handler gets a list of all windows present in the application and destroys the windows. After the last window has been destroyed, the application is quit.
;; Add action "quit" to the application
(let ((action (g:simple-action-new "quit" nil)))
  (g:signal-connect action "activate"
      (lambda (action parameter)
        (declare (ignore action parameter))
        ;; Destroy all windows of the application
        (dolist (window (gtk:application-windows application))
          (gtk:widget-destroy window))))
  ;; Add the action to the action map of the application
  (g:action-map-add-action application action))    
 

See also

2024-3-15