Msg box still dicey?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Msg box still dicey?

Post by [-hh] » Sun Nov 03, 2019 3:10 pm

@Richmond.
It is OK, though sometimes surprising, that you don't understand the OP's intention.
But you really shouldn't be proud of it...
shiftLock happens

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Msg box still dicey?

Post by richmond62 » Sun Nov 03, 2019 3:12 pm

If everyone understood everyone's intention we'd probably not have
much of a discussion.

I am not proud of misunderstanding an OP's intention: but are you sure you've understood it?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Msg box still dicey?

Post by FourthWorld » Sun Nov 03, 2019 4:27 pm

Ah, but what constitutes "worked"?

Is it a bug or a feature that LC's console returns focus to itself for further input?

And FWIW it's not hard to write you're own replacement Message Box. Indeed, language features were added to do exactly that, allowing you to trap Message Box output and display it wherever you like. With an editable field in that window you can accept input, using the defaultStack property to set context before running "do".

With a name change and the quick addition of some init code one could even repurpose the MC MB for use in LC is desired.

Far more than focus, my bigger gripe with LC's MB is that it's a palette, so it's always eating up real estate.

Several years ago I fixed that for myself, and added a terminal-style history along with it, and have been using that ever since. And it's modeless, so I get to later how I want when I want.

If there's interest I can dig up the URL again when I'm at my computer.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Msg box still dicey?

Post by richmond62 » Sun Nov 03, 2019 4:33 pm

it's a palette, so it's always eating up real estate
Not if you dismiss it when it is not in use.

AND not if you make it relatively small:
-
Screenshot 2019-11-03 at 17.31.21.png
-
on a 1920 x 1080 display the Message Box at 640 x 92 does not seem overly hungry. 8)

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Msg box still dicey?

Post by bogs » Sun Nov 03, 2019 4:49 pm

FourthWorld wrote:
Sun Nov 03, 2019 4:27 pm
Is it a bug or a feature that LC's console returns focus to itself for further input?
Well my answer at least is already in on that one, I think for that tool, that is how it should work (like you explained earlier).
FourthWorld wrote:
Sun Nov 03, 2019 4:27 pm
Far more than focus, my bigger gripe with LC's MB is that it's a palette, so it's always eating up real estate.
I agree with that but I'd go a bit further and say that none of the various parts of the IDE (except maybe the menubar) should be palettes, especially when the ordering doesn't work the same across OS'es.
ksnip_PaletteOrder.png
Who is the boss among equals?
FourthWorld wrote:
Sun Nov 03, 2019 4:27 pm
If there's interest I can dig up the URL again when I'm at my computer.
I'd be interested in taking a look at it, if you find the time.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Msg box still dicey?

Post by FourthWorld » Sun Nov 03, 2019 4:52 pm

Exactly. Personally, I find the constant fidgeting with windows in the IDE super annoying, which prompted me to make devolution.

But others don't mind, and others like the way windows are handled.

And because all of it is written in the language we know and love, everyone can mod/hack/replace any part they like to have it reflect their own personal preferences.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Msg box still dicey?

Post by jacque » Sun Nov 03, 2019 4:59 pm

I've seen some anomalies in the message box in the last few versions of LC, where it doesn't recognize the topstack and returns errors like "can't find handler" or "no such object" even when you're looking at the card and have been scripting it. When that happens you have to provide the long name of the object. It's annoying and fairly frequent but I haven't found a recipe yet to report it.

The message box sets the defaultstack to the topstack most of the time but I suspect somewhere in the later versions it's missing that command.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Msg box still dicey?

Post by richmond62 » Sun Nov 03, 2019 5:04 pm

constant fidgeting with windows
Well, that is a matter of taste.

As I am a lucky chap and have 3 biggish monitors attached to my main machine, I "park" all the
palettes "off to the left" so my main stack can take up as much space as it wants on my central monitor.

On my various other machines (where I, generally, have a single monitor) I 'park' my palettes at
the edges of the screen so that the stack can take up the central space.

Personally it is the Menubar stack that gets on my nerves a bit as I can see no real point for the icons,
so I have my settings so they are not displayed.
-
Screenshot 2019-11-03 at 18.02.35.png
-
Similarly, as I normally only use the "traditional" parts of the Toolbar stack, I have the rest hidden.
-
Screenshot 2019-11-03 at 18.02.49.png
Screenshot 2019-11-03 at 18.02.49.png (21.02 KiB) Viewed 6685 times
-
Erm, sorry, slightly off-topic.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Msg box still dicey?

Post by FourthWorld » Mon Nov 04, 2019 7:29 pm

bogs wrote:
Sun Nov 03, 2019 4:49 pm
FourthWorld wrote:
Sun Nov 03, 2019 4:27 pm
If there's interest I can dig up the URL again when I'm at my computer.
I'd be interested in taking a look at it, if you find the time.
I just added it to the Stack Files seciton of LiveNet. In the IDE see Development -> Plugins -> GoLiveNet, and once in the Stack Files section see "4W Console".

It's nice for people who really like Terminal, and may be annoying to everyone else. That's okay. That's kinda the point: by having such a radical reinterpretation of a Message Box, it's less important to me that anyone use this one than to be inspired to make one for yourself that works exactly how you like to work.

It's a bit rough in some areas, mostly due to overly-ambitious goals: lots of extra code for half-finished features like document viewing, document editing, list navigation, and more. Had to set those aside for a bit while I finish some client work, but for the most part basic Message Box use works well.

Tip: While the docs available with "?" are far from completed, there's a set of shortcuts worth knowing about. Since I tend to use this a lot and I'm very picky about window placement, and since when I'm using it I usually have my hands on the keyboard, I added some custom commands in it to place and size it easily.

The command is "c", followed by either "tl", "tr", "bl" or "br", to instantly move the Console window to the top-left, top-right, bottom-left, or bottom right corner of the current monitor, respectively.

You can also pass an integer to the "c" command, which resizes the window to display that many lines.

And you can use those in combination, so for example "c tl 40" will resize the Console window to show 40 lines and place it in the top-left of the monitor.

Enjoy!

PS: Special thanks to Mark Wieder, who has been contributing fixes and additions to it since I first showed it to him at the SoCal Linux Expo a few years back.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Msg box still dicey?

Post by bogs » Mon Nov 04, 2019 9:50 pm

It certainly sounds intriguing, so I jumped right into Lc 6.x instead of Mc (my usual routine), clicked on the 'Run without installing' which I assume is the same as go url. This error was promptly displayed -
Couldn't download stack: error error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
https://www.fourthworld.net/channels/lc ... e.livecode
Executive toy, on the other hand, loaded nearly instantly :D Go figure heh.

*Edit -
When i clicked on the link in the quote from the message box, however, it downloaded lickety split and started up nearly instantly when opened. Go figure part deux.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Msg box still dicey?

Post by FourthWorld » Mon Nov 04, 2019 10:51 pm

bogs wrote:
Mon Nov 04, 2019 9:50 pm
It certainly sounds intriguing, so I jumped right into Lc 6.x instead of Mc (my usual routine), clicked on the 'Run without installing' which I assume is the same as go url. This error was promptly displayed -
Couldn't download stack: error error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
https://www.fourthworld.net/channels/lc ... e.livecode
Executive toy, on the other hand, loaded nearly instantly :D Go figure heh.

*Edit -
When i clicked on the link in the quote from the message box, however, it downloaded lickety split and started up nearly instantly when opened. Go figure part deux.
Curious. Given that it's inconsistent it seems we can safely rule out the server cert config, despite that being the error message's complaint. And given that v6.x is more than three years and dozens of versions behind what I've tested here, the number of people affected by the error may be limited to one, so you'll understand if I don't set up a test config to explore that. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Msg box still dicey?

Post by bogs » Mon Nov 04, 2019 10:53 pm

FourthWorld wrote:
Mon Nov 04, 2019 10:51 pm
you'll understand if I don't set up a test config to explore that.
LOL
Never entered my mind, I posted before giving it my 'usual' testing workout :D
Image

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Msg box still dicey?

Post by bwmilby » Tue Nov 05, 2019 2:58 am

I remember discussing this at San Jose. Pretty cool. I am seeing an error when trying to leave the viewer though. Here's how I solved it:

I put this in the card script:

Code: Select all

on fwClearParentScript
   set the behavior of cd 1 of stack "4wConsole" to empty
end fwClearParentScript
Then I changed line 443 of the 4wConsole stack script to:

Code: Select all

send fwClearParentScript to cd 1 of stack "4wConsole" in 0 milliseconds
This is the error I was seeing:

Code: Select all

parentScript: can't change parent while parent script is executing
Probably would be better to do this as a private handler that is in the stack script though.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Msg box still dicey?

Post by FourthWorld » Tue Nov 05, 2019 6:39 am

bwmilby wrote:
Tue Nov 05, 2019 2:58 am
I remember discussing this at San Jose. Pretty cool. I am seeing an error when trying to leave the viewer though. Here's how I solved it:

I put this in the card script:

Code: Select all

on fwClearParentScript
   set the behavior of cd 1 of stack "4wConsole" to empty
end fwClearParentScript
Then I changed line 443 of the 4wConsole stack script to:

Code: Select all

send fwClearParentScript to cd 1 of stack "4wConsole" in 0 milliseconds
This is the error I was seeing:

Code: Select all

parentScript: can't change parent while parent script is executing
Probably would be better to do this as a private handler that is in the stack script though.
Curious. Recipe?

I don't recall seeing the error, but your change makes sense so I'll add that.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Msg box still dicey?

Post by bwmilby » Tue Nov 05, 2019 1:14 pm

Sorry about that. Just type “?” To get the help screen. Error appears when you type “Q”. Mac Mojave, LC 9.5
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

Post Reply

Return to “Talking LiveCode”