![]() ![]() ![]() Next, we drop in the temperature of 32 degrees. These dimensions should leave a consistent 5 pixel distance from the top, left, and right edges of our window. First, we’ll add the text box where a user can enter a temperature:Ĭall settextboxcontents(original, "32.0")Ībove we’ve created a text box at (5,5) (as measured from the top left) that measures 140 pixels wide and 20 pixels high. Next, we need to add our controls to the window. If you want to see everything together, you’ll be able to download the complete program at the end of this article. We also need to make sure our fonts match Windows as one would expect:Ĭall settextstyle(WINDOWS_FONT, HORIZ_DIR, 10)įinally, we need to redraw our background with the newly assigned background color by clearing the window and forcing a redraw:Īfter combining all of the above code, we should now have a standard blank window with the proper fonts configured. The proper action would be to set the background color to the system’s dialog background color:Ĭall setbkcolor(systemcolor(COLOR_WINDOW_BKGD)) To make our window match the operating system’s themes, we’ll need to also change the background. The closeflag argument instructs AppGraphics to end our program whenever the window closes. We now have a 150 by 255 pixel window with an appropriate title. Myscreen = initwindow(150, 255, title="TempConvert", closeflag=.TRUE.) For this example, we’ll create a long, skinny window as shown in the picture: ![]() In our main program, the first step is to initialize our window. Since our task is so simple, we’ll only need a single Fortran source file to build this. In this quick rundown, we will create a simple application for converting common temperature formats in a simple graphical program written entirely in Fortran. While AppGraphics can be used for drawing shape primitives, it can also be used to easily create a “dialog” experience. Although based on an older drawing library, AppGraphics has ben enhanced with a number of Windows controls, or the standard buttons, text boxes, check boxes common in modern Windows applications. AppGraphics is a simple graphics library designed for creating graphical user interfaces from Fortran. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |