World: r3wp
[I'm new] Ask any question, and a helpful person will try to answer.
older newer | first last |
DavidR 19-Nov-2008 [1534x2] | Thanks everyone for your explanations have tried a couple of scenarios using the subpanels method have not been successful yet but will need to persevere! |
Yes amacleod I could not find any rebol reference to main yet it was there in some programming code | |
DavidR 25-Nov-2008 [1536x2] | I'm afraid I do not understand how sub-panels work can someone give me a commented simple illustration (the simpler the better please) of how they work, sorry to be so thick but its not working in my example? |
I keep getting this error also cannot get rid of it? ** Script Error: panel1 has no value ** Where: func [face value][show panel1] ** Near: show panel1 | |
Graham 25-Nov-2008 [1538] | break your code down to the simplest possible and post it |
james_nak 25-Nov-2008 [1539] | http://www.rebol.com/how-to/subpanels.html |
DavidR 25-Nov-2008 [1540x5] | Thanks james_nak have already looked at that but I still don't get it i'm missing something in the structure or mechanics |
Graham simplist form will try | |
afraid I will have to post it all as there is probably lots of mistakes | |
rebol [Title: "SOS-XP"] view layout [ image center %DT.jpg 768x576 ibevel pewter 6x6 button gray 50x30 "START" [show panel1] at 75x605 button gray 3x30 at 750x610 text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 0.0.50] feel [engage: func [face act] [face/text: now/time show face]] ] panel1: view layout [ image center %DT.jpg 768x576 ibevel pewter 6x6 at 75x605 button gray 3x30 at 750x610 text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 0.0.50] feel [engage: func [face act] [face/text: now/time show face]] at 200x300 area wrap font-color white {You use this program & batch files entirely at your own risk, due to the myriad of hardware/software configurations I cannot without any certainty claim that you will not damage your system! Always Always Always make a full system backup of your partition before attempting to use SOS-XP & that you have tested the back up so your are positive in your own mind you can make a recovery!} red bold at 240x410 button "Agree" [show panel2] at 450x410 button "Disagree" [QUIT]] do-events panel2: view layout [ image center %DT.jpg 768x576 ibevel pewter 6x6 button gray 50x30 "START" [show panel3] at 75x605 button gray 3x30 at 750x610 text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 0.0.50] feel [engage: func [face act] [face/text: now/time show face]] ]755x650 | |
it works up to the second window but when the "agree" button is depressed it stalls & this error message repeats through the interpretor ** Script Error: panel1 has no value ** Where: func [face value][show panel1] ** Near: show panel1 | |
Graham 25-Nov-2008 [1545] | That's not stripped down ... we don't have your images etc. |
btiffin 25-Nov-2008 [1546] | panel2 is not defined when you evaluate panel1 and panel1 is not defined when REBOL is evaluating the main face? No? |
Graham 25-Nov-2008 [1547] | the panels need to be defined earlier panel2: layout [ ... ] |
btiffin 25-Nov-2008 [1548] | I think panel3: layout [ ...] panel2: layout [ ...] pane1: layout [ ...] then the main view layout would work Graham beat me to it. |
DavidR 25-Nov-2008 [1549] | Graham what do you mean by stripped down? |
Graham 25-Nov-2008 [1550x2] | removed of any code not relevant to the problem at hand. |
we couldn't run your code because you referenced images we don't have | |
DavidR 25-Nov-2008 [1552] | I C Sorry! |
Graham 25-Nov-2008 [1553] | next time :) |
DavidR 25-Nov-2008 [1554] | so according to btiffin I am working back to front (panel3 then panel2 then panel1 then the main layout) |
Graham 25-Nov-2008 [1555x5] | doesn't matter the order |
remove the do-events | |
panel1 ... 3 are objects, which are returned by layout | |
you must define them before you use them | |
panel1: view layout [ ] is not defining the layout | |
DavidR 25-Nov-2008 [1560] | EEK! If I remove the do-events the buttons do not work then, this item was suggested by Henrik & it fixed the broken buttons |
btiffin 25-Nov-2008 [1561x4] | Yeah DavidR; the order doesn't really matter as long as the definitions come before REBOL has to reduce the value. REBOL will let you make and load values (simply word! at that stage), but these words have to have a value when evaluation (reduce, do, ... or show in this case) is required. Next... Then change the show panel1 to view panel1 after panel1: layout [ ... ] is used to create the face object. |
And you still need view on the main ... so I take back what I just said ... the main view sets up the do-event event handler for all the faces. (not tested so just rambling now) | |
You may need view/new etc... there are a few options for sub-windows. | |
see hide-popup for a way of closing sub windows | |
DavidR 25-Nov-2008 [1565x2] | Tell ya what without all the code clonk inbetween & as a structure can you provide a simple layout. Yes tried view /new for opening another window with the previous set behind I think it will go up to 8 windows deep? |
according to the readme help files | |
btiffin 25-Nov-2008 [1567x2] | source inform and source request for a sample of how this can all fit together |
Or ... for an easier professional look to an app, I suggest RebGUI. http://www.dobeash.com/rebgui.htmlAshley has done a wonderful job of taking the REBOL view engine one step up (imho). Some may disagree; but RebGUI is my main REBOL graphical app tool. | |
DavidR 25-Nov-2008 [1569x2] | source inform and source request - Is this a different forum |
Yes would like to get around to using it (RebGui) but would like to understand the background mechanics a bit more sorry about the laymans terminolgy but know very little about programming | |
btiffin 25-Nov-2008 [1571] | Sorry, right from the REBOL console >> source inform |
DavidR 25-Nov-2008 [1572x2] | I think I will need to approach this from a different angle will try out some other scenario's |
but many thanks for the help | |
btiffin 25-Nov-2008 [1574] | Anytime |
Anton 25-Nov-2008 [1575x9] | Graham, panel1: view layout [ ] *is* defining the layout. It's also opening it as a window and waiting for events, of course. Remember VIEW just returns the face that it was given. |
Yes, DavidR, it's important to post simple examples. The bugs are laid bare when the irrelevant stuff is not in the code. The images and timer stuff is not essential, for instance - you didn't need to post that. Anyway, we expect that you try with the non-essential stuff removed before posting. Often, then we can just glance at it and tell you what's wrong immediately. | |
Looking at the code, I think you would have been confused by the fact that the first VIEW waits for events. You have a button in there that does SHOW PANEL1, but PANEL1 could not have been set yet in this invocation of the program. That means, if you start this program in a fresh console it will fail, complaining about panel1 not having a value, or, if you had earlier managed to do the panel1 definition code in an earlier version of the code (but still in the same console session), then you would be shown that earlier panel1 version, of course! | |
I have the habit of occasionally throwing away the console session and starting fresh, to see if I've accumulated any bugs of this nature. It's easier to fix them when you notice them earlier. | |
DavidR, here is your program, with the irrelevant stuff removed. | |
rebol [Title: "SOS-XP"] view layout [ button "START" [show panel1] ] panel1: view layout [ area {You use this program & batch files entirely at your own risk} button "Agree" [show panel2] button "Disagree" [quit] ] do-events panel2: view layout [ button "START" [show panel3] ] | |
So now it's clear as day that everything is out of order. | |
Here are some ways to use VIEW and DO-EVENTS. 1) view window 2) view/new window1 view/new window2 do-events 3) window: layout [ button "open child window" [ window2: layout [text "child window"] view/new window2 ] ] view window | |
The thing to note is: VIEW without the /NEW refinement, waits for events. If you don't wait for events this way, then you have to wait for events yourself, using DO-EVENTS. Usually you put DO-EVENTS at the end of your script. | |
older newer | first last |