Giter Club home page Giter Club logo

Comments (2)

bohonghuang avatar bohonghuang commented on July 19, 2024

@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 cffi currently. The solution may seem tricky, but it does work though:

(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)))

from cl-gtk4.

phntxx avatar phntxx commented on July 19, 2024

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.

from cl-gtk4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.