[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Date: Wed, 15 Jan 1992 23:17 CST
From: email@example.com (John K. Myers)
What is the magic for defining a pane without a save-history in dw:define-program-framework?
Make the pane flavor based on TV:Window-Pane and have it handle the
1:Margin-Components0 :init-keyword. [See below.]
One straightforward way would be to define a simple, non-dynamic window pane.
However, :PANES ((PANE-1 :DISPLAY :FLAVOR TV:WINDOW-PANE)...) complains loudly.
I want something simple where I can explicitly move the cursor to pixel locations
Do you really want to explicitly move the cursor? Or is it good enough
to just do a (GRAPHICS:Draw-String ...) ? The latter is cleaner,
especially if the screen is busy. Try the following comparison:
Foo command: Draw Strings (how many? [default 10]) 1000 (set cursor? [default No]) Yes
Foo command: Clear Window
Foo command: Draw Strings (how many? [default 10]) 1000 (set cursor? [default No]) No
Examples of both are below.
and display characters directly onto the screen bits, then clear the window for the
next time, instead of making thousands of presentations that take up space and time.
My apologies if these simple questions have been answered before; couldn't find them.
Best regards, John Myers~~
;;; -*- Syntax: Common-Lisp; Package: USER; Base: 10; Mode: LISP -*-
(defflavor 2My-Window 0()
0 :Command-Definer T
:Command-Table (:Inherit-From '("Colon Full Command"
"Input Editor Compatibility")
:Panes ((No-History :Display
(:Layout (DW::Main :Column
0 ((N 'number
:Prompt "how many?")
:Prompt "set cursor?"))
(Let* ((Pane (DW:Get-Program-Pane 'No-History))
(Width (Send Pane :Inside-Width))
(Height (Send Pane :Inside-height))
(Strings '("Foo" "Bar" "F.U.B.A.R." "BAZ" "Ack" "Phthptt")))
(loop Repeat N
for String = (Nth (random (length Strings))
for X = (random Width)
for Y = (random Height)
do (if Set-Cursor
(Send Pane :Set-Cursorpos X Y)
(Format Pane "~A" String))
(GRAPHICS:Draw-String String X Y
(Send (DW:Get-Program-Pane 'No-History) :Clear-Window))