Wx::Demo - the wxPerl demo


Every demo is a module in the Wx::DemoModules::* namespace. On startup Wx::Demo collects the lits of Demo Modules, tries to load each one of them and displays a list of them based on a categorization within the Demo Modules.

You can also locate Demos based on the widget being use or based on the event used in the example.

Demo Modules

Every Demo Module can supply a tags method that should return extra deep categorization. It should return a reference to a two element array where the first element is the category hierarchy: maincat/subcat and the second element is the title of the given category.

The main categories are hard-coded in the Wx::Demo module (new, controls, windows, etc...)

Every module can have an add_to_tags method that should return a list of names of the categories the module belongs to so these should be strings such as "new", "control", etc... which are main categories or "control/xyz" which is a subcategory definde by one of the Demo modules.

If there is no add_to_tags or if it does not return anything then the demo can only be found from the list of widgets or events. Currently the reason that some packages might have not add_to_tags method is that some of the demos are implemented as several packages in one file. In such case only the main package has the add_to_tags method as only that needs to be added to the list of demos.

Every module must have a title method that returns its title. As far as I can see, the titles are usually the same as the filename.

When one of the Demo Modules is selected in the left pane, the Demo will try to execute its window and if it does not exists then the new method.

There is also an optional file method in the Demo Modules. I think it is used in case there are more than one Demo Packages in the same file.

Some of the Demo Modules use Wx::DemoModules::lib::BaseModule as a base class.


Mattia Barbon <>


This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.