====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
drawing_with_script [2014/07/21 07:18] pierrox syntax highlighting |
drawing_with_script [2014/07/21 07:21] (current) pierrox syntax highlighting |
||
---|---|---|---|
Line 19: | Line 19: | ||
===== Copy an icon from an item to another item ===== | ===== Copy an icon from an item to another item ===== | ||
- | <code> | + | <sxh javascript;> |
var i = LL.getCurrentDesktop().getItemByLabel("some item").getDefaultIcon(); | var i = LL.getCurrentDesktop().getItemByLabel("some item").getDefaultIcon(); | ||
LL.getEvent().getItem().setDefaultIcon(i); | LL.getEvent().getItem().setDefaultIcon(i); | ||
- | </code> | + | </sxh> |
===== Paint a diagonal line over a coloured background ===== | ===== Paint a diagonal line over a coloured background ===== | ||
Line 47: | Line 47: | ||
===== Draw the folder window background with a gradient ===== | ===== Draw the folder window background with a gradient ===== | ||
- | <code> | + | <sxh javascript;> |
var WIDTH = 512; | var WIDTH = 512; | ||
var HEIGHT = 512; | var HEIGHT = 512; | ||
Line 61: | Line 61: | ||
c.drawRect(0,0,WIDTH,HEIGHT,p); | c.drawRect(0,0,WIDTH,HEIGHT,p); | ||
i.update(); | i.update(); | ||
- | </code> | + | </sxh> |