-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems when trying to handle GTK's OPEN signal #3
Comments
@phntxx It may boil down to the upstream library handling signal parameters incorrectly, for which I have opened issue #84. However, it's possible to address this problem via (defpackage test-application-open
(:use #:cl #:gtk4))
(in-package #:test-application-open)
(defun main ()
(let ((app (make-application :application-id "org.bohonghuang.test-application-open"
:flags gio:+application-flags-handles-open+)))
(connect app "activate" (lambda (app)
(gio:application-open app (list (gio:file-new-for-path "/home/coco24/.emacs.d/init.el")
(gio:file-new-for-path "/home/coco24/.emacs.d/local.el"))
"")))
(connect app "open" (lambda (app files n-files hint)
(declare (ignore app hint))
(let ((files (loop :for i :below n-files
:collect (make-instance 'gir::object-instance
:class (gir:nget gio:*ns* "File")
:this (cffi:mem-aref files :pointer i)))))
(print (mapcar #'gio:file-basename files))))) ;; This outputs ("init.el" "local.el")
(gio:application-run app nil))) |
Words cannot describe how thankful I am for your support in this. Thank you very much for the code example, I'll make sure to follow the progress of the issue in the upstream repository. |
Hi!
I'm fairly new to LISP and am currently using this library to create an image viewing program.
However, I've hit a roadblock when trying to handle the "open" signal.
According to the official GTK documentation, the type of
files
isGFile**
, i.e. a pointer to an array ofGFile
elements.I have tried the following:
I have not been able to figure out how to convert this into a LISP-usable list. Could you perhaps point me to a solution or documentation that might aid me in this?
The text was updated successfully, but these errors were encountered: