-
Notifications
You must be signed in to change notification settings - Fork 0
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
How to get the inputs values from an open-editor-window method #72
Comments
Hi Charles, sorry for the super-late reply. Did you find a solution ? If not, and if I understand what you want to do: you should define a (defmethod open-editor ((self your-class))
;;; => do what you want
) |
Hi Jean, I could understand this part, but I do not know how to do this now: Hot to get, for example, the value |
You can't really get the values from the object itself; you need to get it from the box, by querying the value of the input (with The patch evaluation mechanism evaluates a box and passes the values to another box, but the value (or function) inside a box can not know what's in the other boxes. If your define your Py object as an (defclass run-py-f-internal ()
((code :initform "" :accessor pre-delay) ;; no initarg: will not appear as an input
(param :initform nil :accessor param :initarg :param)))
(defmethod object-has-editor ((self run-py-f-internal)) t)
(defmethod get-editor-class ((self run-py-f-internal)) 'py-editor)
(defclass py-editor (omeditor) ())
(defmethod open-editor-window ((editor py-editor))
(print (param (object-value editor)))
;;; open your editor here...
) Or you can define your own box for this (a subclass of (defclass OMBoxPy (OMBoxAbstraction) ())
(defmethod get-box-class ((self run-py-f-internal)) 'OMBoxPy)
(defmethod open-editor ((self OMBoxPy))
(let ((param (omng-box-value (car (inputs box)))))
(print param)
;;; open your editor here...
)) |
Great, thank you very much for the help! |
Hi Jean, I am working on the library om-py, for now I am using the
OMEditor
like in lisp functions to edit Python code.My aim: I'd like to, instead of open OMEditor from like in lisp function, Open VScode when double click in in py function.
To do that, I need the values from inputs connected in the
py
boxes, for example, the value of(1 2 3)
.Finally my question, how could I get this values from the
open-editor-window
method, with therun-py-function-editor
(equivalent torun-lisp-function-editor
).Did you understand?
Thanks!!
The text was updated successfully, but these errors were encountered: