Again, I'm not sure if this is the better way.
| Code: |
function MyWindowName_Initialize(skin, window)
Rainlendar_SetEventHandler(CountEnabledCalendars, 13, window)
Rainlendar_Redraw(0, window)
end
function CountEnabledCalendars(_, window)
value = tonumber(Rainlendar_GetOption("Calendars", "Count"))
active = 0
for i = 1, value do
active = active + tonumber(Rainlendar_GetOption("Calendars/Calendar" .. i, "Enabled"))
end
Rainlendar_SetItemValue(window, "MyWindowName.Text", "text", active .. " of " .. value)
end
|
The only way I found is reading the ini file to know how many calendars I have, and then look for enabled and disabled calendars. (0 is disabled, 1 is enabled).