From KitwarePublic
Jump to: navigation, search


This page provides an entry-point to many examples and step-by-step how-to's demonstrating how to use KWWidgets. Detailed C++, Tcl and Python examples can also be found in the Examples sub-directory in the source tree (turn BUILD_EXAMPLES to ON to build them). Feel free to study and run the examples to get a better idea of the toolkit. Examples can also be used as boiler plates to develop your own applications. You may also want to check some end-user applications based on KWWidgets, such as ParaView and VolView. For a quick peek at the widgets, refer to the screenshots section.

KwGridInfoIcon.png Note: We are trying to add as many examples as possible. We value your feedback and welcome any suggestions. If you are experiencing any difficulties creating a specific UI, please let us know and we will be glad to add the corresponding example.

First Look

The "First Look" page provides a quick glance at some of KWWidgets features like object-orientation, fast-prototyping, scripting, interaction with Tcl/Tk and Python, etc.


Hello World

The KWHelloWorldExample example is a simple stab at the traditional "Hello World" exercise. It shows how to create a simple window and a "Hello World" label (Tcl code / C++ code / Python code).


Tutorial 1

The KWTutorial1 example demonstrates how to create a very simple composite widget step by step. This new widget contains both a label and a checkbutton next to each other. Selecting the checkbutton will change the background color of the label ( C++ code).


Window With Panels

The KWWindowWithPanelsExample example is a slightly more elaborate exercise that makes use of window panels, toolbars, and color choosers (Tcl code / C++ code).


Widgets Tour

The KWWidgetsTourExample example is a great source of information! It is intended to provide a tour of all the widgets and display short code snippets demonstrating how to use each one of them from C++, Tcl or Python. Build the library then run the KWWidgetsTourExample binary, or just launch either the KWWidgetsTourExample.tcl Tcl script located in the Examples/Tcl/WidgetsTour directory or the Python script located in the Examples/Python/WidgetsTour directory.


Simple Medical Image Viewer

The "Simple Medical Image Viewer" page demonstrates how to create a very simple image viewer supporting user-interaction like pan/zoom/window-level and a slice scale. It also concludes with pointers to a more elaborate viewer including slice orientation control, window/level presets and a simple movie/animation creator.


Medical Image Viewer

The KWMedicalImageViewerExample is a more elaborate example showing how quickly one can build a more featured medical image viewer including interactive pan/zoom/window/level, slice orientation control, window/level presets and a simple movie/animation creator (Tcl code / C++ code).


Polygonal Object Viewer

The KWPolygonalObjectViewerExample example shows how quickly one can display a 3D actor in a 3D scene, and interact with the view. This example also features an interactive material property editor, and a simple movie/animation creator (Tcl code / C++ code).



The KWSOViewerExample example shows how to display ITK Spatial Objects using SOViewer inside a KWWidgets interface (C++ code). This is also covered in a FAQ entry. In order for this example to show up during the build process, you need to set KWWidgets_USE_SOVIEWER=ON, and then point SOV_DIR to your SOViewer build directory (say, for example, SOV_DIR=c:\SOViewer-build).



The KWCallbacksExample example demonstrates how to use callbacks within your application. It shows both the traditional one-to-one approach made available by wrapping your C++ methods automatically, or the many-to-many approach using the VTK-oriented event/observer pattern (C++ code).


Wizard Dialog

The KWWizardDialogExample example demonstrates how to use wizards within your application. More information can also be found in the Wizard Workflow page. (C++ code).

KWWidgets: [Welcome | Site Map]