alerts

Mark Smith Mark_Smith at cpe.umanitoba.ca
Fri Nov 12 11:53:06 EST 2010



Robert Brenstein wrote:
> 
> 
> If your saving is done on different cards in a multi-card stack or in 
> multiple stacks, then you can do the above but show a substack 
> instead of a field to ensure it is always above the card controls.
> 
>     disable all controls saving their enabled state
>     show a substack with "saving..." or sth like it as modal
>     save this stack
>     hide the substack
>     enable controls that were enabled before
> 
> You can have the substack window without decorations so user has no 
> temptation to click anywhere.
> 
> Robert
> 

Robert, thanks so much... I was in the midst of writing a reply when you
wrote yours and I think we ended up at the same place (including decorations
which I happened to stumble upon, but appreciate your mention, although I
did not disable all controls (don't know how) and since that might come in
handy for another situation if you have some code I would love to check it
out). Here was my reply to others which fits nicely with your suggestions as
well.....


Have we successfully created a saving alert?

Indeed

1. created a stack
2. called it save
3. added a label, labelled it "Saving notes...."
3. adjusted the card size
4. removed decorations

5. since I was currently saving from 3 places in my program (save button,
save menu, and when quitting the application (auto-save)) decided to write a
"savenotes" handler and put "do savenotes" in the 3 locations (and any
future)

6. wrote handler

on savenotes
   modeless stack "save"
   save this stack
   close stack "save"
end savenotes

7. That worked BUT... unreadable, so re-wrote the handler to make the alert
visible

on savenotes
   modeless stack "save"
   save this stack
   wait 360 millisecs
   close stack "save"
end savenotes

In a previous programming paradigm (procedural) I would have just written a
"save notes" sub routine and called it from wherever. The subroutine would
handle everything in one place: design, placement, presentation, you name
it. Nothing would exist outside except the calls to the subroutine.

Then along came "event driven" programming. In event driven there was a main
event loop just spinning around waiting for user input. Then the main event
would triage the input to the appropriate location. But, if designed
properly, there really only was 1 input location - the main event.

In this environment (object oriented?) things seem to be a bit different.
There are events, but they seem to occur in many places. From there we
either respond immediately, or if more complicated (as in this case) we call
a "handler" somewhere else that can take care of it. So I have the
presentation in one stack (save), the handler in another stack (notepad) and
the input from several different places (buttons, menus, stacks). Its just a
different way of looking at programming, and one I'm still mentally
struggling to sort out. (Plus, it really is more difficult to teach old dogs
new tricks :-)

Like anything, the more you do the more transparent the process becomes.

Thanks again for all your input and feedback. The  alert does look rather
lovely :-)

-- Mark

PS I first wrote this message in my notepad stack. Getting it here presented
a couple of opportunities for new learning…

1. I was unable to cut and paste the whole message from the field to an
intermediate application (TextEdit) before posting it here. (I will try
cutting and pasting from the rev field to the user group directly to see if
that works any better.... AND, it does. So the problem was not with rev but
with Text Edit. And just for grins I cut and pasted to Word and that worked
fine too). 

2. When I pasted it into TextEdit all kinds of spelling errors showed up
that had not been highlighted in the rev field. Is there a way to turn on
spell checking in rev fields?

Thanks again, and i hope you have a great day!


-- 
View this message in context: http://runtime-revolution.278305.n4.nabble.com/alerts-tp3031113p3039933.html
Sent from the Revolution - User mailing list archive at Nabble.com.



More information about the use-livecode mailing list