Topic: SF 2.26 AppGraphics Problem

Hi Jeff,

Yesterday I completed my SF 2.25 with AppGraphics application containing buttons and scroll window and several menu options including a calculator.  The program functioned flawlessly when compiled with SF 2.25 but using SF 2.26 the window text is not displayed, the scroll bar is misplaced, the calculator crashes and the fonts are the wrong size.  When trying to run the program, the main menu is displayed but the program always crashes when I load a data file and try and run it.  There's no error message just a segmentation fault. 

The program uses Appgraphics extensively and since you've modified Appgraphics in this version of SF 2.26, would you please provide more detail on what was changed so that I might identify the problem.  Currently, I don't know where to begin to correct the problem.

Frank

Re: SF 2.26 AppGraphics Problem

Jeff,

In addition to my comments today regarding problems with SF 2.6 and Appgraphics, I reloaded SF 2.25 using the typical option over SF 2.26 and then ran my application within SF 2.25 but without recompiling in SF 2.25 (already compiled in SF 2.26) and it ran just fine and was fully functional.

Frank

Re: SF 2.26 AppGraphics Problem

Frank,

I'll have a look at AppGraphics under 2.26.  My simple tests did work, but I probably have missed something.  The font handling is an extreme mess since everyone has asked for fonts to apply to controls.  Basically, every time the font is changed, an HFONT handle can't simply be destroyed as in the past in case a Windows control is using it.  Instead, the system now has to keep a copy of every font created as a result of settextstyle.  However, to be "memory-safe," all these fonts have to be destroyed when a window closes, so the list of every font has to be freed.  My guess is the list construction is the problem.

I'm guessing that it actually did re-link when you ran it from 2.25 after reinstalling it.  By default, if the Windows GUI option is checked, Simply Fortran will attempt to rebuild the default resource script every time a build is requested, which consequently causes linking to occur again.  If your project is configured to build before launch, this would effectively cause your program to re-link against 2.25's copy of the AppGraphics library.

Jeff Armstrong
Approximatrix, LLC

Re: SF 2.26 AppGraphics Problem

Frank,

Sorting the problem out was rather quick!  As I suspected, constructing the list of created fonts actually fails because of a simple "==" should have been a "!=" instead when checking for a memory pointer's status.  I'll have a new build out tomorrow that should correct the issue completely.

Jeff Armstrong
Approximatrix, LLC

Re: SF 2.26 AppGraphics Problem

Frank,

Build 2149 is now available, and it should fix the issue with changing fonts.

Jeff Armstrong
Approximatrix, LLC

Re: SF 2.26 AppGraphics Problem

Hi Jeff,

Thanks for the font fix in appgraphics.

I'm still having some issues:

1. Minor issue - the vertical window size has changed in this version 2.6.  If the vertical size of the windows are increased by 20 points it works fine.

2. Major issue - crashes on some particular runs with an Error:  Drawing operation was attempted when there was no current window.

3. Not sure, but wondering if my use of your progress bar is creating the problem.  I'll have to look into this deeper.

Frank

Re: SF 2.26 AppGraphics Problem

Jeff,

Update:

Problem solved...

Aside from the change in window vertical dimensions (easy fix by just lengthening the window) and adjusting the font size, my Appgraphics application now is fully functional when compiled with SF 2.26.

The "crash" problem appears to be due to the Appgraphics window progress bar routine you posted or my improper use of it.  After removing the progress window and revising the progress bar to a "text" only progress (e.g., ||||||||||||||||||||) bar using characters, my application runs just fine with no apparent crashes.

Thank you for taking the time to add adjustable fonts for buttons.

Frank

Re: SF 2.26 AppGraphics Problem

Frank,

I'll try looking at that progress bar example again to make sure I haven't introduced a bug.  It is quite likely that I have.

Jeff Armstrong
Approximatrix, LLC