Re: Dialog Director Picts
Re: Dialog Director Picts
- Subject: Re: Dialog Director Picts
- From: Timothy Bates <email@hidden>
- Date: Thu, 20 Sep 2001 16:03:16 +1000
On 9/20/01 3:51 PM, "Stephen Swift (aka Burnum)" <email@hidden> wrote:
>
I know dialog director pretty well, but when it comes to inserting picts in
>
the dialog box - over my head. :-)
>
They way I would think you'd insert a pict is like this:
>
{class:pict, bounds:{0, 0, 100, 100}, contents:129}
>
129 refers to the Id from ResEdit.
>
But when I run the dialog, the pict doesn't appear. What am I doing wrong?
>
Thanks
here's some code I wrote. I gave up with this in the end because it was so
much da*n work placing everything and just built the dialogs in html an
displayed them in a web browser.
set resourceFile to res open alias "Prelude:Apps:PsyScript:d log
osax:Dialog Director v0.7:Examples:graphics:Icons & Picts.rsrc"
try
set pict1 to res get resourceFile type "PICT" id 128
set pictsize to picture bounds of (the picture info for pict1)
res close resourceFile
on error number N
res close resourceFile
error number N
end try
set pictX to item 3 of pictsize
set pictY to item 4 of pictsize
set border to {x:20, y:20}
set button to {width:60, height:20}
set dialogSize to {(pictX + (x of border) * 2), pictY + (y of border) * 1 +
(height of button) + 30}
set x to (item 1 of dialogSize) - (width of button) - (x of border)
set y to pictY + (height of button) + (y of border)
set dialogItems to [,
{class:push button, bounds:[x, y, x + 60, y + 20], name:"OK"}, ,
{class:pict, bounds:[x of border, y of border, pictX + (x of border),
pictY + (y of border)], contents:pict1}, ,
{class:text field, bounds:[60, pictY + 25, 100, pictY + 25 + 15],
enabled:true, name:"from", name bounds:[x of border, pictY + 25, 60, pictY +
20], value:""}, ,
{class:text field, bounds:[140, pictY + 25, 180, pictY + 25 + 15],
enabled:true, name:"to", name bounds:[(x of border) + 100, pictY + 25, (x of
border) + 100 + 40, pictY + 20], value:""}]
dd auto dialog {size:[item 1 of dialogSize, item 2 of dialogSize],
contents:dialogItems, name:,
"Test", style:movable dialog} with grayscale
-- {class:push button, bounds:[x - 80, y, x - 20, y + 20],
name:"Cancel"}, ,
email@hidden>
Macquarie Centre for Cognitive Science (MACCS)
Macquarie University
Ph 61 (2) 9850 8623
Fx 61 (2) 9850 6059