mirror of
https://codeberg.org/cage/tinmop/
synced 2024-12-26 00:02:34 +01:00
- [GUI] bound the wish interpreter handle to a special variable so that the gui event loop can reference it and call, without errors, nodgui functions.
This commit is contained in:
parent
d040aec005
commit
cefbe59be6
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
(defparameter *toplevel* gui:*tk*)
|
(defparameter *toplevel* gui:*tk*)
|
||||||
|
|
||||||
|
(defparameter *gui-server* nil)
|
||||||
|
|
||||||
(a:define-constant +font-h1+ "sans 20 bold" :test #'string=)
|
(a:define-constant +font-h1+ "sans 20 bold" :test #'string=)
|
||||||
|
|
||||||
(a:define-constant +font-h2+ "sans 15 bold" :test #'string=)
|
(a:define-constant +font-h2+ "sans 15 bold" :test #'string=)
|
||||||
|
@ -65,7 +65,7 @@
|
|||||||
(defun notify-request-error (e)
|
(defun notify-request-error (e)
|
||||||
(let ((message (format nil (_ "Comunication with backend failed: ~a") e)))
|
(let ((message (format nil (_ "Comunication with backend failed: ~a") e)))
|
||||||
#+debug-mode (misc:dbg "request error ~a" message)
|
#+debug-mode (misc:dbg "request error ~a" message)
|
||||||
#-debug-mode (gui-goodies:error-dialog gui:*tk* message)))
|
#-debug-mode (gui-goodies:error-dialog gui-goodies:*toplevel* message)))
|
||||||
|
|
||||||
(defmacro with-notify-errors (&body body)
|
(defmacro with-notify-errors (&body body)
|
||||||
`(handler-case
|
`(handler-case
|
||||||
@ -124,10 +124,10 @@
|
|||||||
(defun initialize-menu (parent)
|
(defun initialize-menu (parent)
|
||||||
(with-accessors ((main-window main-window)) parent
|
(with-accessors ((main-window main-window)) parent
|
||||||
(let* ((bar (gui:make-menubar parent))
|
(let* ((bar (gui:make-menubar parent))
|
||||||
(file (gui:make-menu bar (_ "File") :underline 0))
|
(file (gui:make-menu bar (_ "File") :underline 0))
|
||||||
(help (gui:make-menu bar (_ "Help") :underline 0)))
|
(help (gui:make-menu bar (_ "Help") :underline 0)))
|
||||||
(gui:make-menubutton file (_ "Quit") #'menu:quit :underline 0)
|
(gui:make-menubutton file (_ "Quit") #'menu:quit :underline 0)
|
||||||
(gui:make-menubutton help (_ "About") #'menu:help-about :underline 0))))
|
(gui:make-menubutton help (_ "About") #'menu:help-about :underline 0))))
|
||||||
|
|
||||||
(defclass tool-bar (gui:frame)
|
(defclass tool-bar (gui:frame)
|
||||||
((iri-entry
|
((iri-entry
|
||||||
@ -274,6 +274,9 @@
|
|||||||
(gui:with-nodgui (:title +program-name+)
|
(gui:with-nodgui (:title +program-name+)
|
||||||
(icons:load-icons)
|
(icons:load-icons)
|
||||||
(initialize-menu gui:*tk*)
|
(initialize-menu gui:*tk*)
|
||||||
|
(setf gui-goodies:*toplevel* gui:*tk*)
|
||||||
|
(setf gui-goodies:*gui-server* gui:*wish*)
|
||||||
|
(client-events:start-events-loop)
|
||||||
(let ((main-frame (make-instance 'main-frame)))
|
(let ((main-frame (make-instance 'main-frame)))
|
||||||
(gui:grid main-frame 0 0 :sticky :nswe)
|
(gui:grid main-frame 0 0 :sticky :nswe)
|
||||||
(gui-goodies:gui-resize-grid-all gui:*tk*))))
|
(gui-goodies:gui-resize-grid-all gui:*tk*))))
|
||||||
|
@ -23,8 +23,9 @@
|
|||||||
(setf *stop-events-loop* nil))
|
(setf *stop-events-loop* nil))
|
||||||
(setf *events-loop-thread*
|
(setf *events-loop-thread*
|
||||||
(bt:make-thread (lambda ()
|
(bt:make-thread (lambda ()
|
||||||
(loop while (events-loop-running-p) do
|
(let ((gui:*wish* gui-goodies:*gui-server*))
|
||||||
(ev:dispatch-program-events-or-wait))))))
|
(loop while (events-loop-running-p) do
|
||||||
|
(ev:dispatch-program-events-or-wait)))))))
|
||||||
|
|
||||||
(defmacro with-enqueue-request ((method-name id the-error &rest args) &body on-error)
|
(defmacro with-enqueue-request ((method-name id the-error &rest args) &body on-error)
|
||||||
`(ev:with-enqueued-process-and-unblock ()
|
`(ev:with-enqueued-process-and-unblock ()
|
||||||
|
@ -264,7 +264,6 @@ etc.) happened"
|
|||||||
(rpc-server-init)))
|
(rpc-server-init)))
|
||||||
(command-line:*rpc-client-mode*
|
(command-line:*rpc-client-mode*
|
||||||
(rpc-client-load-configuration)
|
(rpc-client-load-configuration)
|
||||||
(client-events:start-events-loop)
|
|
||||||
(json-rpc-communication::start-client)
|
(json-rpc-communication::start-client)
|
||||||
(client-main-window:init-main-window))
|
(client-main-window:init-main-window))
|
||||||
(command-line:*print-lisp-dependencies*
|
(command-line:*print-lisp-dependencies*
|
||||||
|
@ -3256,6 +3256,7 @@
|
|||||||
(:local-nicknames (:comm :json-rpc-communication)
|
(:local-nicknames (:comm :json-rpc-communication)
|
||||||
(:re :cl-ppcre)
|
(:re :cl-ppcre)
|
||||||
(:a :alexandria)
|
(:a :alexandria)
|
||||||
|
(:gui :nodgui)
|
||||||
(:ev :program-events))
|
(:ev :program-events))
|
||||||
(:export
|
(:export
|
||||||
:events-loop-running-p
|
:events-loop-running-p
|
||||||
@ -3315,6 +3316,7 @@
|
|||||||
(:gui-shapes :nodgui.shapes))
|
(:gui-shapes :nodgui.shapes))
|
||||||
(:export
|
(:export
|
||||||
:*toplevel*
|
:*toplevel*
|
||||||
|
:*gui-server*
|
||||||
:gui-resize-grid-all
|
:gui-resize-grid-all
|
||||||
:confirm-deletion
|
:confirm-deletion
|
||||||
:info-operation-completed
|
:info-operation-completed
|
||||||
|
Loading…
Reference in New Issue
Block a user