Addon API Reference
Addon API has some useful API.
UI
UI controling classes
Note
These are only Widget creation function. Widget creation function returns Widget object. To control Widget, you have to use function in Widget object.
- class UI
- parent
Parent UI object. If not having, it is None.
- type: str
- UI object type. UI object is showing Frame widget or window.
main
: Main windowframe
: Frame widgetdialog
: Dialog widget(like Warning window…)sub
: Sub window
- changeTitle(title)
Change window title.
Warning
This works successfully only when UI object type is
main
orsub
- Parameters
title (str) – Title to set.
- changeIcon(icon_path)
Change window icon(it’s on title bar and task bar).
Warning
This works successfully only when UI object type is
main
orsub
- Parameters
title (str) – Icon file path to set.
- fullscreen(tf=None)
Change window to fullscreen.
Warning
This works successfully only when UI object type is
main
orsub
- Parameters
tf (bool) – True to fullscreen. False to fullscreen. default(None) to nomal size.
- changeSize(size)
Change window size.
Warning
This works successfully only when UI object type is
main
orsub
- Parameters
size (str) –
{width}x{height}+{x}+{y}
- uisetting(frame, txt)
The widget for UI setting.
- Parameters
frame (libmarusoftware.Frame) – Frame to show settings.
txt (Lang) – l10n text in dict like object
- setcallback(name, callback)
Set callback.
- Parameters
name (str) –
Callback name.close
: Fire on close window.macos_help
: Click help menu button on Macosmacos_settings
:Click settings menu button on Macoscallback (callable) – Callback function.
- close()
Close window/frame.
- wait()
Wait until close window.
Warning
This works successfully only when UI object type is
main
orsub
- exist()
Return whether the window/frame is open.
- Returns
whether the window/frame is open.
- Return type
- mainloop()
Window Mainloop.
Warning
This works successfully only when UI object type is
main
. And also, must NOT BE run twice or above.
- Label(label=None)
Label widget.
- Parameters
label (str) – Label text
- Returns
Label widget object
- Return type
WidgetBase
- Image(image=None)
Image widget.
- Returns
Image widget object
- Return type
WidgetBase
- Menu()
Menu widget.
- Returns
Menu widget object
- Return type
Menu
- Notebook()
Notebook widget.
- Returns
Notebook widget object
- Return type
Notebook
- class Dialog
- askfile(multi=False, save=False)
Ask filepath Dialog.
- error()
Show error Dialog.
- info()
Show infomation Dialog.
- warn()
Show warning Dialog.
- question(type, title, message)
Asking Dialog.
- Parameters
type (str) –
Ask type.okcancel
: select “ok”(returnTrue
) or “cancel”(returnFalse
)retrycancel
: select “retry”(True
) or “cancel”(False
)yesno
: select “yes”(True
) or “no”(False
)yesnocancel
: select “yes”(True
) or “no”(False
) or “cancel”(None
)text
: Input text. If cancel, returnNone
title (str) – Dialog title
message (str) – Dialog message
- Returns
Selected (or Inputed) value.
- Return type
- class Input
- Button(label='', command=None)
Button widget.
- Parameters
label (str) – Button label.
command (callable) – Button on-clicking callback
- Returns
Button widget object
- Return type
Button
- List()
List widget.
- Returns
List widget object
- Return type
List
- Form(type='text', command=None)
Text inputting widget.(just one line)
- Parameters
type (str) –
Form type.text
: Normal plain text input.password
: Password input.filesave
: Save file asking.fileopen
: Open file asking.fileopenmulti
: Open file asking (multiple).filesavemulti
: Save file asking (multiple).command (callable) – Form on-changing callback
- Returns
Form widget object.
- Return type
Form
- Text(scroll=True, command=None)
Text inputting widget.(multi line)
- CheckButton(label=None, command=None, default=False)
Check button widget.
- Select(default='', command=None, values=[], inline=False, label='')
Select widget.
Logger
Now writing…..
- class Logger