Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[view] Problems with /new and not /new

 [1/12] from: Izkata::Comcast::net at: 13-Aug-2004 18:05


Using view/new works just fine.. The script continues as it should.. But for some reason, even if I hadn't used view/new in the script yet, using only view layout [blah blah] causes the script to continue on and not halt. It usually happens when I click a button in a layout that calls a function that opens another. (Did that make sense?) -Izzy boy ^.^ (Thanx for any help if you understood my request)

 [2/12] from: carl:cybercraft at: 14-Aug-2004 12:59


>Using view/new works just fine.. The script continues as it should.. > >But for some reason, even if I hadn't used view/new in the script yet, >using only view layout [blah blah] causes the script to continue on and not >halt. >It usually happens when I click a button in a layout that calls a function >that opens another. (Did that make sense?)
Hmmm - that's not what I get - View (no /new) always stops the script running until the window is closed. Provide an example if possible. -- Carl Read

 [3/12] from: moliad:aei:ca at: 14-Aug-2004 0:38


when a button opens a window without the /new , it actually adds a new event handler. If you open more than 11 or 12 this way, rebol crashes. memory consumptions might also grow depending on what you are using and the stylesheet used... you should ALWAYS use /new when opening a window beyond the first. -MAx Izkata wrote:

 [4/12] from: gabriele:colellachiara at: 14-Aug-2004 11:47


Hi Maxim, On Saturday, August 14, 2004, 6:38:03 AM, you wrote: MOA> when a button opens a window without the /new , it MOA> actually adds a new event handler. Actually, no. It starts a new handler for the first window only. Try this at the console: view layout [text "hello"] (now press ESC) view layout [text "hello 2"] A new VIEW replaces the first window and does not wait. (See the source for details. :) Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

 [5/12] from: moliad:aei:ca at: 14-Aug-2004 11:05


Gabriele Santilli wrote:
> Hi Maxim, > On Saturday, August 14, 2004, 6:38:03 AM, you wrote:
<<quoted lines omitted: 7>>
> A new VIEW replaces the first window and does not wait. (See the > source for details. :)
Hi Gabriele, Although this SHOULD be true, when working on early versions of glayout, what I described above actually happened... opening a new window would take up ~5 MB all the time. I had done tests using standard VID and it was doing the problem on its own... but the window had to be started from within the ui, while the ui handler was alive. Can't explain it... only describe it :-) -MAx

 [6/12] from: gabriele:colellachiara at: 14-Aug-2004 20:56


Hi Maxim, On Saturday, August 14, 2004, 5:05:50 PM, you wrote: MOA> Although this SHOULD be true, when working on early MOA> versions of glayout, what I described above actually MOA> happened... opening a new window would take up ~5 MB all the MOA> time. That it's taking 5 MB is one thing, but that it is starting a new WAIT is another. I think you probably were having a different kind of problem though. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

 [7/12] from: moliad:aei:ca at: 14-Aug-2004 16:01


Gabriele Santilli wrote:
> I think you probably were having a different kind of problem > though.
but I still was able to open mutliple windows without the /new refinement... in VID directly... which IS weird I agree. my latest test show the expected behaviour... So I expect that some refinement or special thread of useage might break something which otherwise is usually very stable. the 5MB/ windows had to do with stylesheets and was a bug (which was solved)... I just meant that I had a way of confirming that something in rebol was being ADDED even though it should have been replaced... anyways, no point in discussing this further... I can't explain it now... doing a search of the ML might give us some clues, I had discussed some of it here... its been several months... so I don't rememeber the details. ;-) -MAx

 [8/12] from: nitsch-lists:netcologne at: 14-Aug-2004 23:54


A few words about view/ view/new and event-loop: On Samstag, 14. August 2004 01:05, Izkata wrote:
> Using view/new works just fine.. The script continues as it should.. > But for some reason, even if I hadn't used view/new in the script yet,
<<quoted lines omitted: 3>>
> that > opens another. (Did that make sense?)
Makes sense :) Thats because 'view checks if any windows are open. It is not meant to block, but somebody has to start the event-loop. And there is no way to check if events are running already. So by convention, if there are open windows, there is a running event-loop too. Another difference between view and view/new: view closes the current window. view/new adds another one. In combination you can make kind of "browser" where you do go to other scripts when the user presses a button: as convention each script makes a layout and ends with view my-layout now the first script runs. it sees there is no open window, so starts the event-loop (blocks). now the user presses button, we do second script. This script does its view, and now a window is open: 1) view closes the old window. Thats good. otherwise we would have lots of death, uninteresting windows some clicks later. 2) it sees a window is open, so there should be a event-loop. So it does not start a new one (means does no 'wait, 'do-events or such). 3) does not block. so the script returns. 'view was the last command, so that makes no difference. So rebol does some returns, to the button-press, then to the first event-loop. There are no more information about doing the new script on the return-stack. So you can do an unlimited amount of scripts. You can also do the same script alot of times. button-press -> change data, save data, do script again. No stack-flooding. Kind of tail-recursion. Or you can use that like a browser: a script is a "page", has some content and some links (buttons with "do other page"). The other page has some links too. All pages have a "do %main-menu.r". And you have a flexible application where you quickly can add funtions. Only problem are the jumping windows, but for a prototype ok.
> > -Izzy boy ^.^ (Thanx for any help if you understood my request)
-Volker

 [9/12] from: Izkata:Comcast at: 14-Aug-2004 19:53


(I forgot to put this in the first e-mail - REBOL/View 1.2.46.3.1 6-Apr-2004 Core 2.6.0)
> Makes sense :)
Yay lol
> -Volker
Erm.. I understood all that (good for me), but.. In what I'm working on, there is a main layout which opens right away - view center-face layout [blah blah] In it, a button is supposed to open another window as a menu - but in the function, it uses bitmaps in another directory to construct the menu each time it's called. But it isn't pausing to let a person choose one of the images. So, click on "Menu", it opens a second window, click on an image, the second window closes and returns the image to the first window. (To be used as the remaining part of the button's function) Gabriele Santilli wrote:
> view layout [text "hello"] > (now press ESC) > view layout [text "hello 2"] > > A new VIEW replaces the first window and does not wait. (See the > source for details. :)
view/new layout [text "hello 3"] I think I'm finally better understanding how this works.. But not enough to understand and possibly change 'view - or figure a workaround.. Can anyone post a link to, say, and explanation of it, or just the basics here? I'll still be trying to figure it out, and hopefully not annoying anyone, but this may be helpful to other people who, like me, are/were nervous about mailing the list. -Izzy boy

 [10/12] from: nitsch-lists:netcologne at: 15-Aug-2004 3:40


On Sonntag, 15. August 2004 02:53, Izkata wrote:
> In what I'm working on, there is a main layout which opens right away - > view center-face layout [blah blah]
<<quoted lines omitted: 3>>
> called. > But it isn't pausing to let a person choose one of the images.
Ah! Thats inbuild too. Use 'inform instead of 'view. and 'hide-popup instead of unview. inform waits until windows is closed. source request-text for example.
> So, click on "Menu", it opens a second window, click on an image, the > second window > closes and returns the image to the first window. (To be used as the > remaining part of the > button's function) > > > -Izzy boy
-Volker

 [11/12] from: Izkata:Comcast at: 14-Aug-2004 21:09


> Ah! Thats inbuild too. Use 'inform instead of 'view. and 'hide-popup
instead
> of unview. inform waits until windows is closed. > "source request-text" for example.
0.o inbuild? Yay, though - it works! I should probably learn the basics of how View works, though, right? -Izzy boy

 [12/12] from: antonr:lexicon at: 15-Aug-2004 21:41


view layout [button "open" [view/new center-face layout [h1 "sub window"]]] Anton.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted