create widget

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

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

create widget

Post by Samuele » Thu Aug 18, 2022 8:26 pm

Hi, Is there a way to create a widget? in my case, I want to create a switch button, or at least change the one already existing in livecode, is it possible?
Thanks
Samuele.

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: create widget

Post by stam » Thu Aug 18, 2022 8:51 pm

There are lessons on this showing you how to use livecode builder… just search the website for these. But it’s a lot to learn and the language is not what you know…

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: create widget

Post by Klaus » Thu Aug 18, 2022 8:52 pm

Hi Samuele,

what Stam said!
Check these lessons: https://lessons.livecode.com/m/98524


Best

Klaus

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

Re: create widget

Post by richmond62 » Thu Aug 18, 2022 8:52 pm

https://livecode.com/topic/extending-livecode-guide/

Personally I have never looked at that at all as I do not need it for any of my requirements.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9669
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: create widget

Post by dunbarx » Thu Aug 18, 2022 10:33 pm

Samuele.

What sort of switch? I bet it can easily be done in LC script.

Craig

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: create widget

Post by Samuele » Thu Sep 29, 2022 12:02 pm

Hi, been studying :lol: I just want it to look a bit different from the one given for android
Samuele.

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

Re: create widget

Post by richmond62 » Thu Sep 29, 2022 12:13 pm

OK, OK . . .

As LCB is quite a bit more difficult than LiveCode itself why don't you do this:

1. Draw a picture of what you want and post it here.

2. Explain exactly what you want your 'switcher' button to do.

Then we can see if it is possible to work something out in LiveCode and not have to worry about LCB at all.

Is THIS what you mean?
-
Screen Shot 2022-09-29 at 2.16.09 PM.png
Screen Shot 2022-09-29 at 2.16.09 PM.png (7.63 KiB) Viewed 4040 times
-
Or this?
-
Screen Shot 2022-09-29 at 2.17.16 PM.png
Screen Shot 2022-09-29 at 2.17.16 PM.png (4.25 KiB) Viewed 4039 times
-
Screen Shot 2022-09-29 at 2.18.24 PM.png
Screen Shot 2022-09-29 at 2.18.24 PM.png (4.39 KiB) Viewed 4035 times
-
Oh, and while I'm "here" could someone tell me what the supposed functionality of the second one is meant to be? 8)

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: create widget

Post by Samuele » Thu Sep 29, 2022 12:44 pm

The second one. something like this
Immagine 2022-09-29 134448.jpg
Samuele.

Samuele
Posts: 282
Joined: Mon Oct 11, 2021 7:05 pm
Location: Italy

Re: create widget

Post by Samuele » Thu Sep 29, 2022 12:46 pm

the ones you posted work only for apple devices, they're more good looking than the android ones...
Samuele.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: create widget

Post by Klaus » Thu Sep 29, 2022 12:56 pm

Samuele wrote:
Thu Sep 29, 2022 12:46 pm
the ones you posted work only for apple devices, they're more good looking than the android ones...
Nope! All widgets in LC work of course crossplatform, read, they look the same on all devices!

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

Re: create widget

Post by richmond62 » Thu Sep 29, 2022 1:31 pm

I have a feeling that it should be amazingly easy to make those in LiveCode.
-
Screen Shot 2022-09-29 at 3.46.22 PM.png
-
Attachments
Switcher.livecode.zip
Stack
(64.78 KiB) Downloaded 51 times

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 135
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: create widget

Post by bobcole » Fri Sep 30, 2022 2:51 am

Richmond62: Thanks for posting your Switcher stack.

Just for fun I put together a switch control consisting of simple LC graphics grouped together.
By using LC graphics, I was able to change colors, inner glow, add labels ("ON" and "OFF"), move the switch from side to side, etc.
The script is contained in the group so the user can click anywhere in the group to toggle the switch.
Here is my simple stack for your use, modifications or enhancements. I haven't tried to write a resize script.
This was an interesting project.
Enjoy,
Bob

SwitcherBC.livecode.zip
(8.44 KiB) Downloaded 48 times

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

Re: create widget

Post by richmond62 » Fri Sep 30, 2022 7:24 am

Well, Bob, your thing is far more sophisticated than my Q-and-D graphic with two backGroundPatterns.

Mind you, mine involved all of 5 minutes work.

The point (which I have tried to make several times) is that, with LiveCode at least, having to learn LCB
should be redundant as 99% of things should be doable in LiveCode itself.

And, another advantage about doing things in LiveCode instead of LCB is that those things are more
easily modified by other LiveCode users.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: create widget

Post by bn » Fri Sep 30, 2022 8:54 am

Here is an old stack showing switchbuttons and sliders which can be heavily (maybe too much so) configured.


Kind regards
Bernd


customSlider_0_10.livecode.zip
(22.5 KiB) Downloaded 55 times

bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 135
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: create widget

Post by bobcole » Fri Sep 30, 2022 9:00 pm

Bernd:
Your stack is BRILLIANT!
Thank you for posting it.
Bob

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”