
F
Example Programs
This appendix contains nine example programs that supplement the programs in the chapters:
• item_move.c
• scroll_cells2.c
• menu_dir2.c
• type_font.c
• fonts.c
• x_draw.c
• Logo.c
• Bitmap.c
• panel_dnd.c
Some of these programs are extensions to programs presented earlier in this book; they are
listed here to demonstrate extended usage. Other programs in this appendix attempt to inte-
grate features from unrelated XView packages that exceeded the scope of a particular chap-
ter.
F.1 item_move.c
The first program demonstrates how you can use an event handler within a panel to allow the
user to create panel items, move them around within the panel, and delete them. Chapter 7,
Panels, discusses specifics about how panels work. Chapter 5, Canvases and Openwin, dis-
cusses the canvas and openwin issues, since the panel is subclassed from those packages.
Example F-1. The item_move.c program
/*
* item_move.c
* Move items around in a panel using an interpose event handler
* specific to the panel. Two panels are created -- the left panel
* contains panel buttons that allow you to create certain types of
* items that are put in the second panel. Use the MENU (right)
Example Programs
Example Programs 713