Stupid Questions #1

Moderators: LCMark, LCfraser

Post Reply
malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Stupid Questions #1

Post by malte » Mon Jan 02, 2017 12:47 am

Hi all,

I really want to understand widgets. But I can not find the simple examples I need. I would like to start to draw a gradient in a widget. How would I do that?

Cheers,

malte

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

Re: Stupid Questions #1

Post by [-hh] » Mon Jan 02, 2017 3:13 am

Few (properties only):
Dictionary > Choose API: LC Builder > gradient

Much more:
https://github.com/livecode/livecode/bl ... editor.lcb

Essentially: Create a gradient and properties, set the paint to it, fill/stroke the canvas.
For example:

Code: Select all

variable tG as Gradient
put linear gradient with ramp tGRamp into tG
set the paint of this canvas to tG
fill this canvas
shiftLock happens

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Stupid Questions #1

Post by malte » Mon Jan 02, 2017 10:52 am

Thanks HH!

I assume tGRamp needs to be a gradient ramp like it is in LCS? But I bet it must be a typed variable, correct? What does it need to be and how would I fill it? My first try is to style Eleanors / Bernds calendar. I would like to change the header section first and then add a red background for Sat and sundays. I thought that would be an easy enough task to start with, but I fail with the simplest things already. :-(

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

Re: Stupid Questions #1

Post by bn » Mon Jan 02, 2017 11:24 am

Hi Malte,

I feel your pain... :)

It took me QUITE a while to do even simple things in LCB. It looks a lot like Livecode Script but the differences are at times subtle and you have to get used to it. Logging, logging, logging helped once you get over the syntax errors.

As far as gradients are concerned here is a .lcb script that draws a radial gradient and some lines. Techniques borrowed from all over the place. This rough sketch is testing how to turn a circular widget with the mouse for interactivity as in a dial.

It works well in LC 9 DP2 and onwards (that is after Frazer had refactored LCB), in prior versions there was a strange bug in LCB that made the turning movement jump at larger sizes. http://quality.livecode.com/show_bug.cgi?id=17898

Kind regards
Bernd
Attachments
moveTest.lcb.zip
(1.75 KiB) Downloaded 60 times

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Re: Stupid Questions #1

Post by malte » Mon Jan 02, 2017 11:51 am

Thanks Bernd!

How stable is 9? I am currently in Beta phase with one of my apps and plan to release in a month. Do you think it would be too risky to switch to 9?

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

Re: Stupid Questions #1

Post by bn » Mon Jan 02, 2017 12:04 pm

How stable is 9? I am currently in Beta phase with one of my apps and plan to release in a month. Do you think it would be too risky to switch to 9?
that is hard to tell. I don't do commercial software. I use 9 and have little to no problems. Actually the 9 series seems to be the best yet.
Trevor apparently uses DP versions for his commercial software. His reasoning is that he tests extensively and if it works he uses it. Maybe you ask him on Gitter.

Kind regards
Bernd

RamaVerma
Posts: 4
Joined: Mon Nov 06, 2017 1:24 pm

Re: Stupid Questions #1

Post by RamaVerma » Mon Nov 06, 2017 1:34 pm

You may refer some good online material, to begin with or a youtube video which can explain it to you in simple and easy manner.
- Private Consultant (Technology)

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

Re: Stupid Questions #1

Post by richmond62 » Tue Nov 07, 2017 8:08 pm

Do you think it would be too risky to switch to 9?
Personally I would only switch to 9 if there were features in 9 that I 100% needed that were not available in 8.1.7.
CHOP.png
A Developer Preview is a developer preview, it is not meant to be a full-blown system for making programs, and as such should be treated carefully.

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

Re: Stupid Questions #1

Post by FourthWorld » Tue Nov 07, 2017 8:44 pm

malte wrote:
Mon Jan 02, 2017 11:51 am
How stable is 9?
As stable as we users make it, by finding and reporting anything that affects our work.

Once it goes final maintenance will cease on v8, as v9 goes into maintenance and new features go into v10.

So the most useful plan for all experienced devs is to do daily work in the latest build of the highest version number, and ship with the latest build with a frozen feature set ("Stable").
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

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

Re: Stupid Questions #1

Post by [-hh] » Thu Nov 09, 2017 10:48 am

FourthWorld wrote:So the most useful plan for all experienced devs is to do daily work in the latest build of the highest version number, and ship with the latest build with a frozen feature set ("Stable").
Sadly this strategy isn't possible if you are using LCB/ create widgets. Here LC 8 has a frozen "experimental" state (for example 'my resources folder' is in LC 8 not implemented). That's why I stopped making widgets in LC 9, it is so tedious to search which feature doesn't work in LC 8 (especially script access scenarios have changed).
shiftLock happens

Post Reply

Return to “LiveCode Builder”