Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#| | ||
This file is a part of Alloy | ||
(c) 2019 Shirakumo http://tymoon.eu (shinmera@tymoon.eu) | ||
Author: Nicolas Hafner <shinmera@tymoon.eu> | ||
|# | ||
|
||
(in-package #:org.shirakumo.alloy.examples) | ||
|
||
(defclass custom-window (glfw:window) | ||
()) | ||
|
||
(alloy:define-observable show-drop (paths alloy:observable)) | ||
|
||
(defmethod alloy:handle ((event alloy:drop-event) (window custom-window)) | ||
(alloy:notify-observers 'show-drop window (alloy:paths event) window)) | ||
|
||
(define-example drop-files (screen) | ||
(let* ((window (windowing:make-window screen :class 'custom-window)) | ||
(focus (make-instance 'alloy:focus-list :focus-parent window)) | ||
(layout (make-instance 'alloy:border-layout :layout-parent window)) | ||
(label (alloy:represent "Drop some files here!" 'alloy:button :focus-parent focus :layout-parent layout))) | ||
(alloy:on show-drop (paths window) | ||
(setf (alloy:value label) (princ-to-string paths))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters