More flexibility for text widget

Display format is defined as function, and not only "pre" part may be modified.