Create a button's icon with a part of a big image? - Beleaguered Castle
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Create a button's icon with a part of a big image?
Ah, too bad - but at least you have a working solution thanks to Richmond's advice...
Maybe others will find Vectornator useful - having used this for a little while i'm quite impressed and not in the least given the price point...
My go-to vector app has been Affinity Designer (https://affinity.serif.com/en-gb/designer/) - very good app but not cheap (i don't mind paying to support smaller software companies if their product is good, and this is very good).
But I must say, Vectornator gives Designer a run for its money - and its completely free, as is it's iOS counterpart.
S.
Maybe others will find Vectornator useful - having used this for a little while i'm quite impressed and not in the least given the price point...
My go-to vector app has been Affinity Designer (https://affinity.serif.com/en-gb/designer/) - very good app but not cheap (i don't mind paying to support smaller software companies if their product is good, and this is very good).
But I must say, Vectornator gives Designer a run for its money - and its completely free, as is it's iOS counterpart.
S.
Re: Create a button's icon with a part of a big image?
I'm now almost at the end of the project but I encounter a problem with the standalone version.
The standalone works fine on Mac but but the app does not launch on Windows 10. Nothing happen, no error message but the app's name appears in the "Process" tab of Window Task Manager. Each time I double-click on the app's icon, a new process is created... but absolutely nothing appears on the screen.
I built a standalone for Windows a few days ago and it worked fine.
I recently re-built the app menu with the Menu Builder: could the menus be the cause of this problem?
The standalone works fine on Mac but but the app does not launch on Windows 10. Nothing happen, no error message but the app's name appears in the "Process" tab of Window Task Manager. Each time I double-click on the app's icon, a new process is created... but absolutely nothing appears on the screen.
I built a standalone for Windows a few days ago and it worked fine.
I recently re-built the app menu with the Menu Builder: could the menus be the cause of this problem?
-
- Livecode Opensource Backer
- Posts: 10091
- Joined: Fri Feb 19, 2010 10:17 am
Re: Create a button's icon with a part of a big image?
Did you choose a Windows 32-bit or 64-bit build?
Re: Create a button's icon with a part of a big image?
I tested both with the same result.
Of course, I also checked the inclusions and they seem to be OK.
-
- Livecode Opensource Backer
- Posts: 10091
- Joined: Fri Feb 19, 2010 10:17 am
Re: Create a button's icon with a part of a big image?
Make a new stack, put a single button on it, save it, then build standalones and test them.
If they work it is your game, if they don't work it is time to delete LC and all its preference files, caches and so on, then reinstall LC.
If they work it is your game, if they don't work it is time to delete LC and all its preference files, caches and so on, then reinstall LC.
Re: Create a button's icon with a part of a big image?
Done.richmond62 wrote: ↑Mon Aug 22, 2022 4:26 pmMake a new stack, put a single button on it, save it, then build standalones and test them.
If they work it is your game, if they don't work it is time to delete LC and all its preference files, caches and so on, then reinstall LC.
The "empty" Windows standalone works like a charm... I don't know I have to be happy of not

I wonder which part of my code can cause a launch failure on Windows without any error message. I inserted lots of try-catch in the stack opening handlers but I believe the standalone doesn't reach the preOpenStack handler. I believe it fails silently when the standalone LC engine is launched.
Re: Create a button's icon with a part of a big image?
This sounds a bit like the printer driver bug. Does your app support printing?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Create a button's icon with a part of a big image?
No, there is no print functions in my app but I was wrong: it's not a standalone problem: the stack (standalone) is well launched but its windows is just not visible. When it occurs on Mac, we still have the standalone menu bar but not on Windows.
I'm looking deeper in my code but I think my bug is just a "standard" mistake and not a weird standalone problem. I'll keep you informed.
Re: Create a button's icon with a part of a big image?
Problem solved: it appears that loading the substack that contains all the SVGs takes some times, so I had to add a send <message> in 30 to wait during the loading procedure.
Re: Create a button's icon with a part of a big image?
Not sure what your setup is but it's often useful to use a 'splash stack' - a minimal stack with very little code that shows first, then launches the mainstack.
Basically the 'app' is the splash stack built as a standalone which then calls the main stack after app launch - you could have a visual cue such as the spinner widget running so the end user knows the app is running and then dismiss the splash stack when your mainstack (and it's svg substack) is loaded. Or some such
Basically the 'app' is the splash stack built as a standalone which then calls the main stack after app launch - you could have a visual cue such as the spinner widget running so the end user knows the app is running and then dismiss the splash stack when your mainstack (and it's svg substack) is loaded. Or some such

Re: Create a button's icon with a part of a big image?
You are right stam, I will do that. However, the real problem persists: how to know when all the resources of the substacks have been loaded?
Re: Create a button's icon with a part of a big image?
Depends - do u actively load resources? (Eg assign the image data to a control) or do you mean it’s a passive process?
If it’s the former just start your code with “show widget “spinner”, assuming you’ve added a spinner widget and set it’s visible to false, and end the code block with “hide widget spinner”. Or if there is a defined number of images you’re doing this to you could use a progress bar.
If you mean it’s just a passive process I guess you could fake it and just display a spinner or progress bar for a suitable period. On the other hand if passively loading resources is delaying your stack from showing up you could periodically check for visibility of the main stack. Or you could take advantage of the “after <handler>“ structure. Eg add a “after openstack / end openstack” handler in the main stack to dismiss the splash stack.
If it’s the former just start your code with “show widget “spinner”, assuming you’ve added a spinner widget and set it’s visible to false, and end the code block with “hide widget spinner”. Or if there is a defined number of images you’re doing this to you could use a progress bar.
If you mean it’s just a passive process I guess you could fake it and just display a spinner or progress bar for a suitable period. On the other hand if passively loading resources is delaying your stack from showing up you could periodically check for visibility of the main stack. Or you could take advantage of the “after <handler>“ structure. Eg add a “after openstack / end openstack” handler in the main stack to dismiss the splash stack.
Re: Create a button's icon with a part of a big image?
I didn't know the after handler, but it seems dedicated to behavior.
My problem is I don't know precisely why or when my problem occurs. All I can say is when I delay some processes with send ... in some ticks, it works, specially with a standalone.
This is the basic structure I always use:
My problem is I don't know precisely why or when my problem occurs. All I can say is when I delay some processes with send ... in some ticks, it works, specially with a standalone.
This is the basic structure I always use:
Code: Select all
on preOpenStack
hide me // place later the stack according to user prefs file
insert the script of stack (MyMainSubstack) into back // contains some scripts and icons
start using stack "BCAGlobalNetStack" // personal TSNet stack
put ("standalone" is in the environment) into appAlone
repeat for each line thisLine in (the substacks of me)
set cantAbort of stack thisLine to appAlone
end repeat
set cantAbort of me to appAlone
if (not appAlone) then choose Browse Tool
set navigationArrows to false
initConstantes // init some variables and default settings
send "prefsRead" to me in 3 // user prefs file
send "saveGameRead" to me in 5 // savedgame file
opening
end preOpenStack
on opening // effets
prefsStackApply // apply user prefs, previously read from prefs file, including stack dimensions and location
dispatch "openingCard" to card "Main" // "openCard" sens to early to the card "Main" !!!
/*
openingCard in card "Main" : apply all SVGs to all cards game, eventually by looking in a substack containing all SVGs of different card sets
*/
send "showMe" to me in 30 // -------------------- ?????????
// TEST IF ALL IS LOADED AND OK TO SHOW THE MAIN STACK ????
end opening
on showMe
show me
end showMe