Batteries included
This comprehensive tutorial covers the rest of the available functionalities in the framework. These include accessing SQLite3 databases, sending system notifications, utilizing the system tray, theming, multitasking, handling signals, and much more.
Let’s go through them in detail
1. Theming
Themes are what make modern design in Limekit possible.
There are currently 3 categories of themes in Limekit; darklight
, material
, darkstyle
and misc
. Use getThemes()
to get themes for a particular theme category, and setTheme(theme)
to set the theme.
local theme = Theme('darklight')
local allThemes = theme:getThemes()
theme:setTheme(allThemes[1])
2. Dialogs
Limekit offers various dialogs for tasks such as opening files, saving files, receiving input, and more, all of which will be discussed.
File and Folder dialogs
Note
filters
allows you to specify the type of files that will be displayed in the dialog’s file type dropdown filter.
example: {['Image Files'] = {'.jpg', '.png'}, Audio = {'.mp3', '.flac'}, Archieves = {'.zip', '.tar', '.rar'}}
dir
is used to specify the initial directory that the file dialog will open when it’s launched. Pass an empty string to ignore
-- allows opening of files
app.openFileDialog(window, title, dir, filters)
app.saveFileDialog(window, title, dir, filters)
app.folderPickerDialog(window, title, dir)
Input Dialogs
app.textInputDialog(window, title, label)
-- can ignore content
app.multilineInputDialog(window, title, label, content)
-- items: table
-- can ignore startIndex
app.comboBoxInputDialog(window, title, label, items, startIndex)
-- step: increment by
-- can ignore step
app.integerInputDialog(window, title, label, startValue, minValue, maxValu, step)
-- can ignore step
app.doubleInputDialog(window, title, label, value, minValue, maxValue, step)
Alerts
-- returns true or false
-- for an alert like this, you don't really need the result
local result = app.alert(window, title, message)
-- Contains the 'do not show this message again' button
app.infoMessageDialog(window, title, message)
app.aboutAlertDialog(window, title, message)
app.criticalAlertDialog(window, title, message)
app.infoAlertDialog(window, title, message)
-- returns true or false
local result = app.questionAlertDialog(window, title, message)
app.warningAlertDialog(window, title, message)
Other
-- type: hex or RGB
local color = app.colorPickerDialog(window, type)
3. System Tray and System Notification
Learn how to create a system tray icon or send system notifications
System Tray
local tray = SysTray(icon)
Properties
- setIcon(icon)
Sets the icon
- setToolTip(text)
Sets the icon
- setMenu(menu)
Sets menu
checkout Menus
- setVisibility(text)
Sets the visibility
System Notifications
Allows you to send notification from your app.
local tray = SysNotification(icon)
Properties
- setOnClick(callback)
Executed when the notification is clicked
- setMessage{title, message, icon: optional, duration: optional}
Sets the required attributes of a system notification
duration
, ie,2000, 3000, 10000
and not1,2,3,4,5
for seconds