09.03.2015 Views

An IVIB Primer - Unicon

An IVIB Primer - Unicon

An IVIB Primer - Unicon

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

$include "guih.icn"<br />

#<br />

# maindialog is the class created by Ivib in the file main.icn<br />

#<br />

class maindialog : Dialog(MsgBox)<br />

...<br />

method on_ListBtn(ev)<br />

end<br />

method on_about(ev)<br />

end<br />

method on_exit(ev)<br />

end<br />

method on_help(ev)<br />

end<br />

...<br />

end # dialog class<br />

Find the main() procedure and change it if needed so it looks as shown below. This will cause the main screen to<br />

be displayed when the program starts up.<br />

procedure main()<br />

local d<br />

d := maindialog()<br />

d.show_modal()<br />

end<br />

Add code so the About Canvas is displayed when the About Menu item is selected. Add the following code to<br />

on_about():<br />

method on_about(ev)<br />

aboutdialog().show_modal()<br />

end<br />

Add code so the Help Canvas is displayed when the Help Menu item is selected. Add the following code to<br />

on_help():<br />

method on_help(ev)<br />

helpdialog().show_modal()<br />

end<br />

We also need to add code to terminate the application when the Exit menu item is selected. Add the dispose()<br />

function to on_exit().<br />

method on_exit(ev)<br />

dispose()<br />

end<br />

Save this file as main.icn. Make sure you save it in the directory you made for this application.<br />

Makefile<br />

The following instructions mainly apply to Linux/UNIX users. Now we need to create a makefile to compile and<br />

14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!