Re: Integrating Lua to the core of Litestep.
Tomas <osten.einarsson-cgr7CL/[email protected]>
| Newsgroups | gmane.comp.windows.shells.litestep |
|---|---|
| Message-ID | <[email protected]> |
Reworked the idea with the help of tnl and the-golem, hope its more real
lua than cc. Anyway i got no solotion for the callbacks, for example
lets say we got a label which we want to open the popup menu when the
user clicks on it. How would you do it?
function Init()
-- Jdesk
jdesk = JDesk {
WorkArea= {0, 0, 0, -44}
}
--Popup
popup = Popup {
HotListName = ThemeName,
AutoSeperator = true,
TitleBgColor = ColorDark,
GradientSelEntry = ColorDark,
EntryColor = ColorText,
SelEntryBgColor = ColorDark,
}
--LsxCommand
command = LsxCommand {
X = 0,
Y = -40,
Width = 200,
Height = 21,
BorderSize = 1,
BackgroundColor = ColorLight,
BorderColor = ColorBorder,
TextColor = ColorText,
}
-- XTaskbar
taskbar = XTaskbar {
X = 0,
Y = -21,
Width = ScreenWidth(), -- Should systems vars be funcs
or vars?
Height = 21,
UseSolidColors = true,
SolidBevelSize = 1,
FontColor = ColorText,
MaxButtonWidth = 200,
NormalFontLeftBorder = 17,
}
-- VTray
tray = VTray {
X = -20,
Y = - 40,
Width = 200,
Height = 21,
AlwaysOnTop = true,
BackgroundColor = ColorLight,
BorderColor = ColorBorder,
BorderSize = 1,
}
end
Jochen Ritzel wrote:
> Meh, you'd have to rethink your idea in real lua, this looks like
> crappy C code. We dont need tons of set/get methods, callbacks and
> stuff like that in Lua. If you really want to do it, then do it
> properly. If you don't mind rewriting half the core, every theme and
> module ever released, please go ahead. I always liked the idea.
> But then, maybe it's too much work for textfile cosmetics.
>
> If you just want it pretty or less typing, you can just write
> preprocess parser that generates .rc files from any syntax you like.
> I've been writing my themes in some css like language, its actually
> pretty neat.
>
>
> On Wed, 08 Aug 2007 20:59:20 +0200, Tomas
> <osten.einarsson-cgr7CL/[email protected]> wrote:
>
>> So this is another push to make Litestep more dynamic by integrate
>> the scripting language Lua to the core. I've read the thread "rant:
>> Scripting in Litestep" so I know this have been suggested before and
>> there are a lot of skepticism against making Litestep themes harder
>> to make by demanding programming skills from the themers. But I cant
>> really understand why something like this example with XtaskBar could
>> be any harder even for non-programmers, it just depends on the
>> documentation. In my opinion its look cleaner and its makes it easier
>> to understand for newcomers and you don't really need any experience
>> in programing just because there are some more symbols in every line
>> (":", "()" and "=" ).
>>
>> taskbar = xTaskbar()
>> taskbar:SetX(5)
>>
>> than the current .rc syntax
>>
>> *xTaskbar taskbar
>> taskbarX 5
>>
>> I would like to hear your opinions and suggestions to this.
>>
>> For example a theme config could look like this (based on the default
>> theme in LOSI):
>>
>>
>> -- Theme.lua
>> ThemeName = "InstDef"
>> ThemeAuthor = "Tobbe"
>> ColorDark = "a58f65"
>> ColorLight = "d5cab5"
>> ColorBorder = "3d3423"
>> ColorText = "262116"
>>
>> function Init()
>> -- Jdesk
>> jDesk = JDesk()
>> jDesk:SetWorkArea(0, 0, 0, -44)
>> -- Popup
>> popup:SetHotListName(ThemeName)
>> popup = Popup()
>> popup:SetAutoSeperator(true)
>> popup:SetTitleBgColor(ColorDark)
>> popup:SetGradientSelEntry(ColorDark)
>> popup:SetEntryColor(ColorText)
>> popup:SetEntryBgColor(ColorLight)
>> popup:SetSelEntryBgColor(ColorDark)
>> -- LsxCommand
>> command = LsxCommand()
>> command:SetX(0)
>> command:SetY(-40)
>> command:SetWidth(GetScreenWidth() - 199)
>> command:SetHeight(21)
>> command:SetBorderSize(1)
>> command:SetBackgroundColor(ColorLight)
>> command:SetBorderColor(ColorBorder)
>> command:SetTextColor(ColorText)
>> -- XTaskbar
>> taskbar = XTaskbar()
>> taskbar:SetX(0)
>> taskbar:SetY(-21)
>> taskbar:SetWidth(GetScreenWidth())
>> taskbar:SetHeight(21)
>> taskbar:SetUseSolidColors(true)
>> taskbar:SetSolidBevelSize(1)
>> taskbar:SetFontColor(ColorText)
>> taskbar:SetMaxButtonWidth(200)
>> taskbar:SetNormalFontLeftBorder(17)
>> -- VTray
>> tray = VTray()
>> tray:SetX(-200)
>> tray:SetY(-40)
>> tray:SetWidth(200)
>> tray:SetHeight(21)
>> tray:SetAlwaysOnTop(true)
>> tray:SetBackgroundColor(ColorLight)
>> tray:SetBorderColor(ColorBorder)
>> tray:SetBorderSize(1)
>>
>>
>> end
>>
>> ls.Connect("Init", Init)
>>
>> -- End theme.lua
>>
>>
>> ---------------------------------------------------------------------
>> Can't Unsubscribe? Check http://desktopian.org/listunsub.html
>> LS List Homepage: http://wuzzle.org/list/litestep.php
>> Get the LS FAQ: http://lsfaq.shellfront.org
>
>
>
> ---------------------------------------------------------------------
> Can't Unsubscribe? Check http://desktopian.org/listunsub.html
> LS List Homepage: http://wuzzle.org/list/litestep.php
> Get the LS FAQ: http://lsfaq.shellfront.org
>
>
---------------------------------------------------------------------
Can't Unsubscribe? Check http://desktopian.org/listunsub.html
LS List Homepage: http://wuzzle.org/list/litestep.php
Get the LS FAQ: http://lsfaq.shellfront.org