Most of the information in this section is based on example dialogs some time ago, which unfortunately were not widely available as they were shipped with the source, but not installed. You should find them in your tools menu under examples in the “tutorial” section. Keep in mind most of these particular examples use the old parser. That is neither good nor bad. Most of the functionality in Kommander is shared in both parsers. It's just each is particularly suited to do a better job with a given task. As Kommander now defaults to the new parser you can set either one. Please see the New Parser docs for more information on the two parsers.
When examining example dialogs remember to look in the following places to see how things are done.
Dialog Initialization - middle click on the dialog face or right click and select Kommander Text. Here you see what is run when the dialog starts.
Buttons - middle click the button, or right click. Scripts are typically here.
Widgets - some widgets like Timers and Konsoles will hold instructions inside them.
Signals and Slots - this is how Qt/KDE programs internally communicate.
The following list of dialogs may be brief so as to focus on where more information is required to explain more complex tasks possible with Kommander. They were copied from Michal's notes.
Shows using global and setGlobal DCOP calls to provide global variables for script
Functions/concepts: - global - setGlobal - changeWidgetText
Shows how to use both local and external DCOP calls to communicate with external application (here: KMail).
Functions/concepts: - external DCOP - addListItem - enableWidget - @selectedWidgetText - @widgetText
Shows how to us connections/slot to handle events. Both population and standard slots are used.
Population text was originally developed before Kommander DCOP, specials and scripting. Given that everything it does can be done in other ways and that it is easy to forget to look here for problems, along with the inherent difference of introducing an additional behavior to explain, this is a deprecated function. It is left in for illustration, however while Kommander dialogs will be easy to port to KDE4 this feature is not assured to work in the future. Don't use it!
standard slots are used. - slots/connections - populate()
Shows how to use @readSetting and @writeSetting functions to write/restore widget content. Also, show how to use populate() slot to initialize widget content.
Functions/concepts: - @readSetting - @writeSetting - populate() - slots/connections - destroy
Shows how you can append text to TextEdit and how you can use it to display formatted text. See newer examples for how to use slots to edit rich text and new font and color dialogs too.
Functions/concepts: - changeWidetText - RichTextEdit
Shows how you can pass parameters to Kommander dialog via command line. Also, shows how to change list content and button text. See the section on passing arguments in the new parser for more on this.
Functions/concepts: - command-line arguments - global - changeWidgetText - addListItem - clearList
Shows how you use 'initialization' to 'destroy' scripts of main dialog to initialize and store some settings.
Functions/concepts: - initialization - destroy - readSetting - writeSetting
Shows how to use associative arrays to store and restore information associated with container items.
Functions/concepts: - @Array functions
Shows how to use string-handling functions Functions/concepts:
- @String functions - rich text editor
Shows how to use @expr function to do some calculations
- expr - String.replace
The @expr() function is no longer required in the new parser as expressions can be directly interpreted anywhere you would logically want to use them.
Shows how to use PixmapLabel widget using populate() function
- PixmapLabel - populate - FileSelector - slots/connections
Would you like to comment or contribute an update to this page?
Send feedback to the TDE Development Team