[REBOL] Inform Window
From: info::id-net::ch at: 3-Apr-2002 18:03
Hi !
I'm trying to make new inform window without the exit X button on the top
right, because i don't know how to trap
the behavior when it's done (the request/ok window produce a "none" when the
window is closed but not the inform window)
So I produced a window composed by a make face box and in the pane of this
face a layout. The result is a inform window with
a little blue box where the title of the window is displayed and the rest is
a layout (like it's done when you make a inform box).
I got 2 problems:
1) when i remove the /new raffinement of view (line 89: button "Dialogue 2"
[view/new/options dialog-new [no-title no-border] ]
i can move the inform window but not when the /new raffinement is
present.
2) The appereance of a Inform Window stop the code of running, waiting on a
user's behavior. How Can I make that ?
Try the code below. It's based on a old code found on the net.
REBOL [
Title: "Dialog Box"
File: %dialog.r
Date: 20-May-2000
Purpose: {
Pops up a dialog requestor that displays a message
and waits for the user to click a button.
}
Category: [view VID 1]
]
move-it: func [pos] [
pos: pos + 250x250
return pos
]
centré: system/view/screen-face/size
centré/x: system/view/screen-face/size/x / 2
centré/y: system/view/screen-face/size/y / 2
print centré
;obj/offset: max 0x0 face/size - obj/size / 2 + face/offset
bonbon: layout [button "salut"]
dialog-deux: make face [
size: 400x400
offset: 300x300
pane: bonbon
]
dialog-new: make face [
size: 400x200
offset: 1x1
color: 212.212.212
Effect: [gradient 1x1 0.8.132 14.129.207]
text: "Alert Window"
font: make font [color: white style: [bold]]
edge: make edge [effect: 'bevel ]
pane: make face [
size: 0x0
offset: 0x0
color: 212.212.212
edge: none
]
feel: make feel [
engage: func [face action event] [
if action = 'down [
face/data: event/offset
]
if find [over away] action [
face/offset: face/offset + event/offset - face/data
]
show face
]
];feel
] ; dialog-new
size2: make pair! 0 0
size2/x: dialog-new/size/x / 2
size2/y: dialog-new/size/y / 2
dialog-new/offset: centré - size2
dialog-new/pane/offset: 0x18
dialog-new/pane/size: dialog-new/size - 1x18
size-lo: dialog-new/pane/size
offset-lo: dialog-new/pane/offset
ddd: layout/offset/size [
backdrop 212.212.212
button "Unview/only" [unview/only dialog-new]
text "jdsfjakdjf"
radio
] offset-lo size-lo
dialog-new/pane: ddd
view layout [
backdrop effect [gradient 0.100.0 0.0.0]
title white "Example"
button "Click for Dialog" [inform dialog]
button "Dialogue 2" [view/new/options dialog-new [no-title no-border] ]
;button "dialogue 3" [view/new/options dialog-deux [no-title no-border]]
button "Quit" [quit]
box 200x200 orange
]
Philippe