Page 1 of 1

Stupid Questions #1

Posted: Mon Jan 02, 2017 12:47 am
by malte
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

Re: Stupid Questions #1

Posted: Mon Jan 02, 2017 3:13 am
by [-hh]
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

Re: Stupid Questions #1

Posted: Mon Jan 02, 2017 10:52 am
by malte
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. :-(

Re: Stupid Questions #1

Posted: Mon Jan 02, 2017 11:24 am
by bn
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

Re: Stupid Questions #1

Posted: Mon Jan 02, 2017 11:51 am
by malte
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?

Re: Stupid Questions #1

Posted: Mon Jan 02, 2017 12:04 pm
by bn
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

Re: Stupid Questions #1

Posted: Mon Nov 06, 2017 1:34 pm
by RamaVerma
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.

Re: Stupid Questions #1

Posted: Tue Nov 07, 2017 8:08 pm
by richmond62
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.

Re: Stupid Questions #1

Posted: Tue Nov 07, 2017 8:44 pm
by FourthWorld
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").

Re: Stupid Questions #1

Posted: Thu Nov 09, 2017 10:48 am
by [-hh]
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).