home *** CD-ROM | disk | FTP | other *** search
- (* An Icon Viewer Example Program*)
- (*Eric Anderson*)
- (* ⌐ 1990 Moon Valley Software Inc.*)
-
- (*Define the main Application Window*)
- w1 is window(,18,10,30,12,'Icon Viewer',
- [Popup,Visible,MinimizeBox,
- showchildren,ControlMenu,
- TitleBar,ThickFrame]).
-
- menu([&View,&About,E&xit], GetOption). (*The App Menu*)
-
- icn is load_icon('KPWIN.ICO'). (*Load an icon for the App.*)
-
- attach_icon(?w1,?icn). (*Attach the icon to the App.*)
-
-
- topic GetOption(menu_item). (*Create The Menu*)
- do (?menu_item).
-
- topic &View. (*Choose an icon display*)
- (*Display the list box*)
- list_box(dir ('*.ico'), select, 2, 2,,,,, [list_select_event]).
-
- end.
-
- topic select (item, event ). (*Display the selected icon*)
- item is load_icon(?item). (*If there is an event load the icon*)
- icon(?item,20,2). (*Display the icon*)
- end.
-
- topic &About. (*The About Box*)
- w2 is window(,26.42,6,41.14,13,'About Icon Viewer',
- [DialogWindow,Visible,TitleBar]).
- text ('
- Icon Viewer
-
- Knowledge Pro for Windows
- Example Program
-
- ⌐ Copyright 1990
- Moon Valley Software Inc.
-
- ').
-
- (*The OK button in the about box: *)
- b1 is button ('&OK',Done,14.71,9.875,12).
- set_focus(?b1). (*Set the input focus*)
-
- topic Done. (*Close the About Box*)
- close_window(?w2).
- end.
-
- end. (* &About *)
-
- topic E&xit. (*Close the program*)
- clear (). (* Closes all windows, frees all memory, etc. *)
- end.
-
- end. (*GetOption*)