Root_menu = addmenu(NULL, MENU_FOR_WINDOW) * Some functions prototypes to be called from menu clicks *./ When adding a menu item, though, we can also add a subroutine to be called when the menu item is clicked. The above creates a “File” menu on a window’s menu bar with two options, “Save” and “Quit.” When the user clicks “Save,” for example, the function save() will be called. One should note, however, that the call to save() will be within another thread. Item = addmenuitem("Quit", file_menu, quit) Item = addmenuitem("Save", file_menu, save) See the section on threads for more information. In the Fortran example, we’re adding “Save” and “Quit” items to a “File” menu as well. Note that the save and quit procedures are subroutines without arguments. These subroutines can be module procedures also, as long as they are within the scope of the subprogram that is calling addmenuitem. Like their C counterparts, the save() and quit() subroutines will be executed from a separate thread. Drawing in the WindowĪppGraphics provides a significant number of different line, text, and shape drawing procedures. These can all be called from the main program or any callback function without any problems. The examples below both create a few simple shapes within the main window. The above example first draws a red rectangle measuring 150 pixels wide and 100 pixels tall. The next call draws a blue, filled ellipse over this rectangle with the same dimensions. The call to setfillstyle() is using some predefined colors provided by AppGraphics the developer may also specify a color in red-green-blue values using the creatergb() function. The Fortran example works identically to the C example. This simple tutorial shows the basics of working with AppGraphics. Users can also add more complicated features such as multiple windows, buttons and textboxes, mouse-handling callbacks, and interactive graphics. #Simply fortran appgraphics floodfill windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |