Skip to content
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

Can't create simple application. #50

Open
Filipp-Druan opened this issue Nov 22, 2023 · 4 comments
Open

Can't create simple application. #50

Filipp-Druan opened this issue Nov 22, 2023 · 4 comments

Comments

@Filipp-Druan
Copy link

Filipp-Druan commented Nov 22, 2023

Hello!
I tried to write the most simple application:

(define-application (:name main
                     :id   "qwertyuiop")
  (define-main-window (main-window (make-application-window :application
                                                            *application*))
    (setf (window-title main-window)
          "Share-files")

    (let ((main-box (make-box :orientation +orientation-vertical+
                              :spacing     0)))
      (setf (window-child main-window)
            main-box)
    
      (window-present main-window))))

When I called main function I got this:

Backtrace:
 0: (GIR::G-SIGNAL-CONNECT-CLOSURE NIL "activate" #.(SB-SYS:INT-SAP #X7FF90EB56AF0) NIL)
 1: (GIR:CONNECT NIL "activate" #<FUNCTION (LAMBDA (&REST GTK4::ARGS) :IN GTK4::ATTACH-RESTARTS) {10074D8B1B}> :AFTER NIL :SWAPPED NIL)
      Locals:
        #:.DEFAULTING-TEMP. = NIL
        #:.DEFAULTING-TEMP.#1 = NIL
        AFTER = NIL
        C-HANDLER = #<FUNCTION (LAMBDA (&REST GTK4::ARGS) :IN GTK4::ATTACH-RESTARTS) {10074D8B1B}>
        C-HANDLER#1 = #<FUNCTION (LAMBDA (&REST GTK4::ARGS) :IN GTK4::ATTACH-RESTARTS) {10074D8B1B}>
        FLAGS = 0
        G-OBJECT = NIL
        #:G0 = #<FUNCTION (LAMBDA (&REST GTK4::ARGS) :IN GTK4::ATTACH-RESTARTS) {10074D8B1B}>
        OBJECT-PTR = NIL
        SIGNAL = "activate"
        STR-SIGNAL = "activate"
        SWAPPED = NIL
 2: (QWERTYUIOP.MAIN NIL)
      Locals:
        GTK4::ARGV = NIL
 3: (SB-INT:SIMPLE-EVAL-IN-LEXENV (MAIN) #<NULL-LEXENV>)
 4: (EVAL (MAIN))
 5: ((LAMBDA NIL :IN SLYNK-MREPL::MREPL-EVAL-1))
 --more--

application = NIL

@bohonghuang
Copy link
Owner

Your application ID is invalid. For example, you can set it to org.filipp.qwertyuiop.

@Filipp-Druan
Copy link
Author

Thanks!
Can you write rules of application id naming in documentation?

@Filipp-Druan
Copy link
Author

I suggest creating a file of NOTES in which to put such non-obvious points.

@bohonghuang
Copy link
Owner

In the official documentation of GTK4, it is mentioned in the new constructor of Application:

If application_id is not NULL, then it must be valid. See g_application_id_is_valid().

Please refer to the GIO documentation for the rules regarding application IDs.

Currently I haven't found a good way to embed the official documentation of GTK and related libraries into Lisp's Docstring. Therefore, referring to the official documentation directly is still the preferred method for troubleshooting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants