Each object in a form has its own programmable actions. General actions are
script that will be executed when a mouse click on this object occurs
script that will be executed when a mouse doubleclick on this object occurs
script that will be executed when the form is created or put into viewmode
script that will be executed when the form is closed or put into designmode
script that will be executed when this object gets the keyboard focus
script that will be executed when this object looses the keyboard focus
script that will be executed when this object has the keyboard focus and a key on the keyboard is pressed
Let's write a 'hello world' program. Create a new form and add a button. Select the button and click on the 'On click'-actionbutton in the property editor. Now add the following program into the program editor
Now close the window and change to viewmode. When you push the button you will see a dialog window with "Hello world".
The global variable hk_this is set from hk_classes and represents the current object, in this case the button. show_warningmessage() is a method of this object, that allows you to display a string in a GUI independent way (as KNODA is a KDE application it will be displayed as a KDE window but if you start it within a command line program it will be displayed on the standard output).
Other GUI-independent ways for user interaction are
displays 'message' and returns true if you answer 'yes'. The parameter 'default_value' is used for convenience to preselect 'yes' or 'no' in dialog boxes
displays 'text' as a question and returns your response
In forms another global variable is hk_thisform. It represents the form. In reports the variable name is hk_thisreport.