Questions regarding standalones on Linux

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Questions regarding standalones on Linux

Post by redfield »

Hey All,
I have let LC create a Linux standalone of my script. One thing I noticed: the standalone window will always open exactly where the corresponding LC window was placed, while creating the standalone. Is that "correct" behaviour? I have no idea what it usually depends on, where on the screen a program chooses to place itself, when opening. But I always had the feeling that programs open at a random point on the screen or maybe there where they were last before being closed or so.

Second: I would like to be able to quit the standalone by using the shortcut ctrl + q. I tried by placing a keyDown handler in the stack script, but without success. I tried something like

Code: Select all

on keyDown ctrl q
quit
end keyDown

Third: Is there any way to place a little program icon at the upper left of the standalone (on Linux)?

Many thanks in advance :D
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Questions regarding standalones on Linux

Post by Klaus »

Hi redfield,

1.
Well the runtime is the "former" stack (with all its properties like LOC etc) with the engine "wrapped" around it, so this is normal behavior!
You need to add something like:

Code: Select all

on preopenstack
  set the loc of this stack to the screenloc
endpreopenstack
2.
"keydown" only accepts ONE parameter and does not catch any "special" keys like SHIFT, ALT, Control etc.! Use "commandkeydown", that should do the job:

Code: Select all

on commandkeydown tKey
  if tKey = "q" then
   quit
  end if
end commandkeydown
3.
Sorry no idea, never used Linux.


Best

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

Re: Questions regarding standalones on Linux

Post by bogs »

What Klaus said, with the following additions:
* screenLoc is center screen, if your program gets moved around a lot, you might want to write it's last location to a file, and set the preopen handler to place it at the loc in the file.
* The place you would normally set the application icon I *think* is in the standalone settings, however, where Mac and Windows have an entry for one, Linux does not :?

I think it is possible, and don't see any reason why it would not be, but am not sure of the exact way to go about it. However, it is worth noting that I don't think I ever saw a linux application with an application icon attached to the window in any way shape or form either. Look at the windows you open on 'nix, they are (at least as far as I know) devoid of a window icon, so adding one would be a consistency issue.
Icons? We don' need no steenkin icons...
Icons? We don' need no steenkin icons...
Image
redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: Questions regarding standalones on Linux

Post by redfield »

Thanks both for your replies.
Klaus wrote: Sun Jun 16, 2019 2:39 pmso this is normal behavior!
Ok.
Klaus wrote:You need to add something like:

Code: Select all

on preopenstack
  set the loc of this stack to the screenloc
endpreopenstack
I will try this, whereas the Dictionary doesn't know 'loc' but only 'location'.


bogs wrote: you might want to write it's last location to a file
Interesting, will try that too.
bogs wrote: I don't think I ever saw a linux application with an application icon attached to the window
This is how it looks on my Linux:
icon4.png
icon4.png (17.68 KiB) Viewed 9626 times
And in my own program there's some kind of placeholder or so:
icon2.png
icon2.png (18.02 KiB) Viewed 9626 times
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Questions regarding standalones on Linux

Post by Klaus »

loc = short for location! :D
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Questions regarding standalones on Linux

Post by bogs »

Just out of curiosity, which desktop are you using on linux?
Image
redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: Questions regarding standalones on Linux

Post by redfield »

This is XFCE (running on an Arch system).
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Questions regarding standalones on Linux

Post by bogs »

Huh, mine is also running XFCE. Which theme are you using?
Image
redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: Questions regarding standalones on Linux

Post by redfield »

Well in this case it's Koynacity. The themes seem to have a configuration file, containing the line
show_app_icon=(true or false)
So if set to true, icons are displayed but it's a puzzle to me, how the theme "knows" which icon to grab for which program. This is probably far too complicated stuff for me. :?
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Questions regarding standalones on Linux

Post by bogs »

Well, I doubt it is too complicated, but it certainly is unusual. As I said, I never saw that before, and I thought I had tried every theme at least once :P
Image
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Questions regarding standalones on Linux

Post by FourthWorld »

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Questions regarding standalones on Linux

Post by bogs »

Was there a particular starting point of the 480 some odd lines of the specs you were thinking of that applies to application icons in the window?

That is a good reference (and one I use often), but I must have missed that entry.
Image
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Questions regarding standalones on Linux

Post by FourthWorld »

bogs wrote: Tue Jun 18, 2019 10:14 am Was there a particular starting point of the 480 some odd lines of the specs you were thinking of that applies to application icons in the window?
Yes. I have no time for randomness (perhaps instead of "Is there a point?", suggesting the possibility of pointlessness, you'd meant to write "What is the point?", which merely seeks clarification).

redfield wrote:
it's a puzzle to me, how the theme "knows" which icon to grab for which program
The spec I'd linked to defines how icon associations are made with a .desktop file.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
bogs
Posts: 5480
Joined: Sat Feb 25, 2017 10:45 pm

Re: Questions regarding standalones on Linux

Post by bogs »

FourthWorld wrote: Tue Jun 18, 2019 5:05 pm Yes. I have no time for randomness (perhaps instead of "Is there a point?", suggesting the possibility of pointlessness, you'd meant to write "What is the point?", which merely seeks clarification).
I apologize for not saying it more clearly, the question wasn't meant to read "Is there a point because it looks pointless", but instead was supposed to read
bogs wrote: Tue Jun 18, 2019 10:14 am Was there a particular starting point of the 480 some odd lines of the specs you were thinking of that applies to application icons in the window?
I *always* assume you have a point to make, but sometimes the replies you post are a little .... oh, I dunno, vague I guess.

Kind of like when you say things like "Did you read the entire manual that comes in PDF format to understand one point about [x] in LiveCode". Instead of
FourthWorld wrote: Mon Jun 17, 2019 10:50 pm Welcome to the rabbit hole:
https://standards.freedesktop.org/deskt ... atest.html
it easily could have been
FourthWorld wrote: Mon Jun 17, 2019 10:50 pm Welcome to the rabbit hole, this section on "Desktop entries" should get you started:
https://standards.freedesktop.org/deskt ... atest.html
I KNOW you to be a prolific writer when the mood suits you, I don't think adding 2 to 9 more words would have killed you :wink:
Image
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Questions regarding standalones on Linux

Post by FourthWorld »

bogs wrote: Tue Jun 18, 2019 8:54 pm Kind of like when you say things like "Did you read the entire manual that comes in PDF format to understand one point about [x] in LiveCode".
When did I write that?
I KNOW you to be a prolific writer when the mood suits you, I don't think adding 2 to 9 more words would have killed you :wink:
Which would explain why I didn't say it would kill me.

I handle about hundred correspondences a day. Some are more detailed than others. I figure folks will ask if anything's not clear.

So to be clear here, the spec is about a lot more than icons, generally useful when deploying to Linux. Those unfamiliar with it will want to be. Those familiar with it will know that's where icon associations are handled.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Post Reply