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
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).
Important: Other GUI-independent ways for user interaction are
- show_warningmessage(message)
displays 'message'
- bool show_yesnodialog(message, bool default_value)
displays 'message' and returns true if you answer 'yes'. The parameter 'default_value' is used for conevience to preselect 'yes' or 'no' in dialog boxes
- hk_string show_stringvaluedialog(text)
displays 'text' as a question and returns your response