Suffering from a Brain Fart...

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Suffering from a Brain Fart...

Paul Dupuis
Help,

I was to open a modal dialog from a single handler and continue the
handler, updating certain information in a dialog, in a repeat loop.

The 'modal <stack>' command pauses the handler execution until the
dialog is closed (presumably from a button in the dialog itself).
Therefore I need to open the dialog with something other than the modal
command?

I have done this before, but for whatever reasons, I can not remember
how to do it nor can I find any sample code in any of my stacks where I
have done this.



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Suffering from a Brain Fart...

Roger Eller
Try

toplevel stack "myStack"

~Roger


On Tue, Nov 22, 2016 at 5:10 PM, Paul Dupuis <[hidden email]> wrote:

> Help,
>
> I was to open a modal dialog from a single handler and continue the
> handler, updating certain information in a dialog, in a repeat loop.
>
> The 'modal <stack>' command pauses the handler execution until the
> dialog is closed (presumably from a button in the dialog itself).
> Therefore I need to open the dialog with something other than the modal
> command?
>
> I have done this before, but for whatever reasons, I can not remember
> how to do it nor can I find any sample code in any of my stacks where I
> have done this.
>
>
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Suffering from a Brain Fart...

Ray Horsley-2
In reply to this post by Paul Dupuis
Would it work for you to hide the visible stack(s) and open the stack
being used as a dialog window as a palette?  Then re-show the visible
stack(s) when the palette is closed.

On 11/22/2016 5:10 PM, Paul Dupuis wrote:

> Help,
>
> I was to open a modal dialog from a single handler and continue the
> handler, updating certain information in a dialog, in a repeat loop.
>
> The 'modal <stack>' command pauses the handler execution until the
> dialog is closed (presumably from a button in the dialog itself).
> Therefore I need to open the dialog with something other than the modal
> command?
>
> I have done this before, but for whatever reasons, I can not remember
> how to do it nor can I find any sample code in any of my stacks where I
> have done this.
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Suffering from a Brain Fart...

Richard Gaskin
In reply to this post by Paul Dupuis
Paul Dupuis wrote:

 > I was to open a modal dialog from a single handler and continue the
 > handler, updating certain information in a dialog, in a repeat loop.
 >
 > The 'modal <stack>' command pauses the handler execution until the
 > dialog is closed (presumably from a button in the dialog itself).
 > Therefore I need to open the dialog with something other than the
 > modal command?
 >
 > I have done this before, but for whatever reasons, I can not remember
 > how to do it nor can I find any sample code in any of my stacks where
 > I have done this.

I usually prefer to break up the handler for code flow simplicity, but
IIRC you should be able to open the dialog invisibly, then show it and
go to it "as modal" and it'll retain the modal layering while allowing
the current handler to keep running.

It's been a long time since I've tried that, though, and with all the
event changes for Cocoa I wouldn't be surprised if the event management
was tightened up a bit since then.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Suffering from a Brain Fart...

Bob Sneidar-2
THAT is interesting! Out of curiosity, I wonder if a stack can then go to itself non-modally! I've often wanted to have a menu item that can de-modalize an open stack so I can step through the code when troubleshooting.

Bob S


On Nov 22, 2016, at 14:16 , Richard Gaskin <[hidden email]<mailto:[hidden email]>> wrote:

I usually prefer to break up the handler for code flow simplicity, but IIRC you should be able to open the dialog invisibly, then show it and go to it "as modal" and it'll retain the modal layering while allowing the current handler to keep running.

It's been a long time since I've tried that, though, and with all the event changes for Cocoa I wouldn't be surprised if the event management was tightened up a bit since then.

--
Richard Gaskin

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Suffering from a Brain Fart...

RogGuay
I often use a script like this at the stack level, but I’m sure I’m missing your point.

on controlKeyDown pKey

if pKey = "e" then set the style of stack "TextOmatic" to topLevel

if pKey = "p" then set the style of stack "TextOmatic" to palette

end controlKeyDown


Roger




> On Nov 22, 2016, at 4:04 PM, Bob Sneidar <[hidden email]> wrote:
>
> THAT is interesting! Out of curiosity, I wonder if a stack can then go to itself non-modally! I've often wanted to have a menu item that can de-modalize an open stack so I can step through the code when troubleshooting.
>
> Bob S
>
>
> On Nov 22, 2016, at 14:16 , Richard Gaskin <[hidden email]<mailto:[hidden email]>> wrote:
>
> I usually prefer to break up the handler for code flow simplicity, but IIRC you should be able to open the dialog invisibly, then show it and go to it "as modal" and it'll retain the modal layering while allowing the current handler to keep running.
>
> It's been a long time since I've tried that, though, and with all the event changes for Cocoa I wouldn't be surprised if the event management was tightened up a bit since then.
>
> --
> Richard Gaskin
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: Suffering from a Brain Fart...

J. Landman Gay
In reply to this post by Bob Sneidar-2
On 11/22/16 6:04 PM, Bob Sneidar wrote:
> I've often wanted to have a menu item that can de-modalize an open
> stack so I can step through the code when troubleshooting.

On Mac, Cmd-Ctrl-Shift-rightclick to get the contextual menu. Choose
Stack -> Stack Mode -> toplevel.

--
Jacqueline Landman Gay         |     [hidden email]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

AW: Suffering from a Brain Fart...

Paul Dupuis
In reply to this post by Paul Dupuis
Thank you all for the replies.
...
open inv <stack> as modal
show <stack>
repeat <some repeat expression>
  wait 0 with messages -- to allow any controls in the dialog to function
  -- do repeat loop stuff, updating dialog items as needed
end repeat
close <stack>
...
does get you a modal dialog while the script continues, where as
...
modal <stack>
...
put up the dialog and pauses the script until the dialog window is closed



On 11/22/2016 5:10 PM, Paul Dupuis wrote:

> Help,
>
> I was to open a modal dialog from a single handler and continue the
> handler, updating certain information in a dialog, in a repeat loop.
>
> The 'modal <stack>' command pauses the handler execution until the
> dialog is closed (presumably from a button in the dialog itself).
> Therefore I need to open the dialog with something other than the modal
> command?
>
> I have done this before, but for whatever reasons, I can not remember
> how to do it nor can I find any sample code in any of my stacks where I
> have done this.
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode