| allegro-cl archives 1997-3-2 | home index prev H thread prev K thread-next J next L |
|
From: Dmitri Ivanov Subject: ACLW 3.0.1: Two problems when loading IB generated dialogs Date: 1997-3-2 4:11
1. I can't load the IB generated dialog code from Builder Open Window menu
(see the source file at very bottom).
;; Error: Unbound variable EDGE-PROPERTIES in EDGE-PROPERTIES
The error appears even if the package SIMULA-GRAPHER exists before this
effort. I suspect the reason is using a package other than
COMMON-LISP-USER.
After choosing the Abort restart, I discovered:
------------------------------------------------
Apropos on "EDGE-PROPERTIES" in all packages
-----------------------------------------
"EDGE-PROPERTIES" in COMMON-LISP-USER
MAKE-EDGE-PROPERTIES
EDGE-PROPERTIES function
---------------------------------------
"EDGE-PROPERTIES" in SIMULA-GRAPHER
SIMULA-GRAPHER::MAKE-EDGE-PROPERTIES function
SIMULA-GRAPHER::EDGE-PROPERTIES bound function
Why have I got the EDGE-PROPERTIES fbound both in COMMON-LISP-USER and
SIMULA-GRAPHER packages?
The usage of File Load menu command instead of Builder Open Window seems to
remedy the first problem.
2. I can't make the dialog with an up-and-down-control widget. While
initializing buddy widget, ACLW seems to look for the up-and-down control
inside the frame, not inside the dialog:
;; Error: No method in generic function DIALOG-ITEMS is applicable
;; to arguments: #<HIERA-GRAPH-FRAME Some-frame #xE1EAF4>
Sincerely,
Dmitri Ivanov
<aha.ru at divanov>
The file edge-dlg.bil is as follows:
-----------------------------------------------------------------------
;; Define the slot-setter-dialog Edge-Properties
(in-package :simula-grapher)
(defvar edge-properties nil)
;; Return the window, creating it the first time or when it's closed.
;; Use only this function if you need only one instance.
(defun edge-properties ()
(if (windowp edge-properties) edge-properties
(setq edge-properties (make-edge-properties))))
;; Create an instance of the window.
;; Use this if you need more than one instance.
(defun make-edge-properties (&key (parent *lisp-frame-window*)
(window-interior (make-box 7 166 459 451))
(name 'edge-properties)
(title "Edge Properties"))
(setq *loaded-but-uncreated-windows*
(delete 'edge-properties *loaded-but-uncreated-windows*))
(let (window-0 window-1 window-2 window-3 window-4)
(setq window-0
(open-dialog
(list
(make-dialog-item
:widget 'static-text
:name :width-static
:title (delete #\Newline "")
:value (delete #\Newline "~Width")
:box (make-box 5 134 87 156)
:tabstop nil
:groupstart t
:background-color t
:font
(make-font-ex :swiss :ms\ sans\ serif 13 '(:bold))
:tab-control nil)
(make-dialog-item
:widget 'cancel-button
:name :cancel-button
:title (delete #\Newline "~Cancel")
:box (make-box 330 12 447 36)
:tabstop t
:groupstart nil
:help-string
(delete #\Newline "")
:set-value-fn 'return-nil-from-pop-up-dialog
:font
(make-font-ex :swiss :ms\ sans\ serif 13 '(:bold)))
(make-dialog-item
:widget 'default-button
:name :default-button
:title (delete #\Newline "~OK")
:box (make-box 205 12 322 36)
:tabstop t
:groupstart nil
:help-string
(delete #\Newline "")
:set-value-fn 'return-t-from-pop-up-dialog
:font (make-font-ex :swiss :system 17 '(:bold)))
(make-dialog-item
:widget 'up-down-control
:name :up-down-control-1
:title (delete #\Newline "")
:value 0
:box (make-box 164 134 184 156)
:tabstop t
:groupstart nil
:background-color t
:help-string
(delete #\Newline "Press arrows to change the width")
:buddy-side :right
:delayed nil
:orientation :vertical
:range (list 0 10)
:buddy-widget 'width)
(make-dialog-item
:widget 'lisp-text
:name 'width
:title (delete #\Newline "")
:value 0
:box (make-box 119 134 166 156)
:tabstop t
:groupstart t
:help-string (delete #\Newline "Line width")
:set-value-fn 'library:slot-setter-set-value-fn
:value-equality-test 'equalp
:font (make-font-ex nil :courier 13 nil)
:dirty t
:tab-control nil
:up-down-control :up-down-control-1))
'library:slot-setter-dialog parent
:name name
:title title
:font (make-font :swiss :system 20 '(:bold))
:window-state :shrunk
:window-border :frame
:left-attachment nil
:top-attachment nil
:right-attachment nil
:bottom-attachment nil
:user-movable t
:user-resizable t
:user-closable t
:user-shrinkable nil
:user-scrollable nil
:overlapped nil
:background-color light-gray
:pop-up-p t
:window-interior window-interior))
(setf (window-editable-p window-0) t)
(setf (getf (stream-plist window-0) :path)
(let* ((pathname (load-time-value *load-pathname*)))
(if
(or (not (pathnamep pathname))
(member (pathname-type pathname) *fsl-extensions*
:test #'string-equal))
"D:\\Projects\\Sim\\Graph\\edge-dlg.bil"
(namestring pathname))))
(setf (getf (stream-plist window-0) :startup-state) :pop-up)
(setf (getf (stream-plist window-0) :top-level-p) nil)
(setf (help-string window-0) (delete #\Newline nil))
(setf (getf (stream-plist window-0) :package) :simula-grapher)
nil
(let* ((box (getf *window-exteriors* (object-name window-0))))
(when box (reshape-window-exterior window-0 box)))
(show-window window-0 :shrunk)
window-0))
(unless (windowp edge-properties)
(pushnew 'edge-properties *loaded-but-uncreated-windows*))
|