home *** CD-ROM | disk | FTP | other *** search
- /* ILBMViewer - An example of using the dissidents rx_intui.library */
-
- /* Present File requester for user to pick the picture to load */
- /* Get a FileIO structure */
- fileio=GetFIO()
- IF fileio == '' | fileio == 0 THEN SAY 'FileIO allocation error'
-
- /* Do the File Requester with INFO_SUPPRESS. Since we pass 0 for screen, this */
- /* opens on WB. Note: If no FileIO, this does nothing and returns path = null. */
- path=FioWindow(fileio,'Choose Picture File:',128,,,,,0)
-
- /* Free the FileIO. If no FileIO, this does nothing. */
- err=EndFIO(fileio)
-
- IF path > '' THEN DO
-
- /* Let the lib open a window/screen for us, and load the picture. */
- wind=IFFLoad(0,0,path)
- IF wind == '' | wind == 0 THEN SAY 'Window open error'
-
- /* Trap the RIGHT MOUSE button so that we can use it for ourselves. We're */
- /* going to use the menu button to bring up the color requester, and the */
- /* select button to exit the program */
- err=ModIDCMP(wind,,,65536)
-
- /* Get the window's screen. If no window, this returns 0 for screen */
- screen=PEEK(wind,46,2)
-
- /* Here's our IDCMP loop. When the lib opens a window, it's default IDCMP is */
- /* MOUSEBUTTONS only. If no window (ie 0), this loop breaks out immediately. */
- class = 1
-
- DO WHILE class > 0
- spec=WaitMsg(wind)
- /* divide the spec into separate parts */
- PARSE var spec class part1 part2 part3
-
- IF class == 3 THEN DO
- /* If select DOWN, set class to 0 */
- IF part1 == 0 THEN class = 0
- /* If menu DOWN, bring up the color requester */
- IF part1 == 2 THEN err=Color(screen)
- END
-
- END
-
- /* Close the window that the lib opened, thus freeing any resources for it. */
- /* Note that if no window opened (ie 0), this does nothing. */
- err=EndWindow(wind)
-
- /* Close the screen that the lib opened, thus freeing any resources for it. */
- /* Note that if no screen opened (ie 0), this does nothing. */
- err=EndScreen(screen)
-
- END
-