You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.8 KiB
61 lines
1.8 KiB
13 years ago
|
How to Write Samples for the PyKDE Sampler
|
||
|
==========================================
|
||
|
|
||
|
|
||
|
Create or locate a directory within the sampler application root directory.
|
||
|
|
||
|
Add a module.
|
||
|
|
||
|
In side the module, add the following:
|
||
|
|
||
|
- iconName - string (optional)
|
||
|
default: 'filenew'
|
||
|
example: 'colorize'
|
||
|
|
||
|
When supplied, this should be the short name of a KDE icon, such as
|
||
|
'stop', 'editclear', etc. If available, This icon will be used as
|
||
|
the list item's icon in the sampler. Not all icons are available in
|
||
|
all themes, so try to use the icons that are available in the
|
||
|
default KDE installation.
|
||
|
|
||
|
|
||
|
- labelText - string (optional)
|
||
|
default: module name
|
||
|
example: 'KMessageBox'
|
||
|
|
||
|
When supplied, this value is used as the list item text for the
|
||
|
sample. If it's not supplied, the application will use the name of
|
||
|
the module instead.
|
||
|
|
||
|
|
||
|
- docParts - two-tuple (optional)
|
||
|
default: None
|
||
13 years ago
|
example: ('tdeui', 'KAboutDialog')
|
||
13 years ago
|
|
||
|
If specified, this sequence should contain two items, first item
|
||
13 years ago
|
name of pytde module, second item name of class within the module.
|
||
13 years ago
|
These two values are used to form the URL to the documentation for
|
||
|
the sample.
|
||
|
|
||
|
|
||
13 years ago
|
- one of buildWidget, buildDialog, buildApp, MainFrame - callable (retquired)
|
||
13 years ago
|
default: None
|
||
13 years ago
|
example: MainFrame(TQFrame): ...
|
||
13 years ago
|
|
||
|
The sample module must contain a callable with one of these names.
|
||
|
The callable must accept a single positional parameter, the parent
|
||
|
widget.
|
||
|
|
||
13 years ago
|
In most cases, it is sufficient to define a subclass of TQFrame named
|
||
13 years ago
|
'MainFrame'. To construct a more complex sample, define a function
|
||
|
with one of the other names.
|
||
|
|
||
|
The callable should return (or instatiate) a widget for display in
|
||
|
the main sampler widget. The created frame is responsible for
|
||
|
displaying it's help text and for any providing any widgets
|
||
|
necessary to
|
||
|
|
||
|
|
||
|
|
||
|
|