Opening views without closing existing views???
[1/11] from: yvan_iigs:gmx at: 12-May-2006 18:10
Hello,
I have a new problem with views. Please take a look at the following code:
view layout
[
text "Titel" FTitel: field
button "OK" [if/else [empty? FTitel/text]
[
view layout
[
text "Enter Title"
button "OK" [unview/all]
]
]
[unview/all]
]
What I want to do is:
1. If something is entered in the Field and I click "OK" the view is closed.
2. If nothing is entered in the view and I click "OK" then
-> a new view is opened with the text "Enter Title" -> without closing
the old view <-
-> when I click "OK" in the new view, the new view is closed and -> I'm
still left with the old view <-
1. Works
2. doesn't work, as soon as I click OK the old view is closed and a new view
appears.
How can I keep the old view?
Cheers
Yvan
[2/11] from: SunandaDH:aol at: 12-May-2006 12:29
Yvan:
> How can I keep the old view?
Try this:
view1: view layout
[
text "Titel" FTitel: field
button "OK" [if/else [empty? FTitel/text]
[
view2: view/new layout
[
text "Enter Title"
button "OK" [unview view2]
]
]
[unview/all]
]
]
Notes:
1. I've given the views names so you can unview specific ones
2. note the view/NEW on the inner view
Incidentally: if/else works, but is definitely deprecated in REBOL. Consider
using either instead.
Sunanda
[3/11] from: nick:guitarz at: 12-May-2006 9:55
Hi Yvan,
Also, the condition argument of the if/else (either) should not be
enclosed in a block:
view layout [
text "Title" FTitle: field
button "OK" [
either (FTitle/text = "") [
view/new layout [
text "Enter Title"
button "OK" [unview]
]
][
unview/all
]
]
]
Quoting Yvan <yvan_iigs-gmx.net>:
[4/11] from: nick:guitarz at: 12-May-2006 9:59
Oops - my mail client doesn't handle tabs well:
view layout [
text "Title" FTitle: field
button "OK" [
either (FTitle/text = "") [
view/new layout=09[
text "Enter Title"
button "OK" [unview]
]
][
unview/all
]
]
]
Quoting Yvan <yvan_iigs-gmx.net>:
[5/11] from: nick:guitarz at: 12-May-2006 10:05
Hi Yvan,
In the script below, please remove the "3D" from the "=3d", and the
and the script will operate correctly :)
Can anyone recommend a webmail program that will handle those
characters better for this mailing list?
Thanks!
- Nick
Quoting Nick Antonaccio <nick-guitarz.org>:
[6/11] from: ronaldoff::free::fr at: 12-May-2006 19:21
Hi Yvan,
You should try the /new refinement :
view layout[
text "Titel" FTitel: field
button "OK" [either empty? FTitel/text
[
view/new newlay: layout
[
text "Enter Title"
button "OK" [unview newlay focus Ftitel]
]
]
[unview/all]
]]
But you can also use 'flash like this :
view firstlay: layout[
text "Titel" FTitel: field
button #"^M""OK" [either empty? FTitel/text
[
fl: flash "Enter Title"
wait 0.5 unview/only fl
focus FTitel
]
[unview firstlay]
]]
Notice the #"^M" that lets you action the button by pressing "Enter"
Hope this will help you.
Best regards
Ronald
[7/11] from: anton::wilddsl::net::au at: 13-May-2006 13:16
That should be unview/ONLY :
> view layout[
> text "Titel" FTitel: field
<<quoted lines omitted: 4>>
> text "Enter Title"
> button "OK" [unview newlay focus Ftitel] ; <---- bad
button "OK" [unview/only newlay focus Ftitel] ; <--- good
> ]
> ]
> [unview/all]
> ]]
Unview by itself will close just the last opened window,
which only works until you open a second window.
But, to be honest, this approach to field validation
seems to be not a good one, if I understand what you're trying
to do. Why open a second window asking for the same information?
That's just moving the problem to a second window.
How about something like this ?
view center-face layout [
text "Titel" FTitel: field
button "OK" [
either empty? FTitel/text [
FTitel/edge: make FTitel/edge [color: red]
focus FTitel ; (also does a SHOW)
][
unview
]
]
]
Anton.
[8/11] from: yvan_iigs:gmx at: 13-May-2006 16:21
Hello Ronald,
thanks, the #"^M"" is cool :)
On 12.05.2006, you wrote:
[9/11] from: yvan_iigs:gmx at: 13-May-2006 16:23
Hello Anton,
okay, this is clever, thanks
On 13.05.2006, you wrote:
[10/11] from: yvan_iigs:gmx at: 13-May-2006 16:25
Hello Nick,
thanks, and by the way I'm using YAM as mailer and it doesn't havve this
problem. All you need is a computer able to running MorphOS or AmigaOS to
use YAM.
On 12.05.2006, you wrote:
[11/11] from: yvan_iigs::gmx::net at: 13-May-2006 16:26
Hello Sunanda,
thanks, it's amazing how fast people are helping on this list.
Cheers
Yvan
On 12.05.2006, you wrote:
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted