Inconsistency between Windows and Linux

113 views
Skip to first unread message

John Wasilewski

unread,
May 26, 2014, 12:21:15 PM5/26/14
to dislin...@googlegroups.com
BACKGROUND
I have written a large, complex application using GFortran, and using Dislin both for the GUI and for program graphics.
I am attempting to create executables under both Windows and Linux.  The exact same source file compiles, links, loads and runs without error, in both:
- Micro$oft Windows 7.
- Linux Mint.

I use Approximatrix Simply Fortran as my WIndows IDE and CodeBlocks-Fortran as my Linux IDE.  Both of the IDEs use GFortran - the Windows and Linux versions of GFortran, obviously.

In my project, I have split the screen into three 'panes':
LEFT-UPPER pane is a vertical scrolling text output pane.
RIGHT-UPPER pane displays 'HELP' text and output graphics.
ACROSS-BOTTOM pane is where the GUI displays user-editable input data.

The only change I have had to make when porting from Windows to Linux is to load what I am assuming is the correct version of DISLIN.  The laptop on which I've created a Linux version of my project is an old HP 1GB 'Compaq nc4400' with Intel Core 2 CPU T7200 @ 2.0GHz x 2, and the operating system is Linux Mint rev.16 'Cinnamon', 32-bit.  (which, by the way, is a BRILLIANT way of bringing back to life LIKE NEW any old laptop that was thrown away years ago because it could not cope with the latest versions of Windows).

I have used  this Dislin install file:
      dislin-10.4.linux.i586.deb

To emit the initial 'HELP' text, the program uses a sequence of calls like these:
LH = 43
CALL HEIGHT(LH)

CALL MESSAG
+('The program uses the stiffness method to solve bending '//
+ 'moments, axial and shear forces at member ends of linear',LX,LY)
LY = LY+LS+LH
CALL MESSAG
+('elastic rigid-jointed skeletal framed structures. The highly '//
+ 'efficient ''skyline'' storage method is used to compact the',
+ LX,LY)
LY = LY+LS+LH
CALL MESSAG
+('stiffness matrix, enabling very large problems to be solved '//
+ 'entirely in memory. Numbers of nodes, members, material',
+ LX,LY)
LY = LY+LS+LH
CALL MESSAG
+('types, member types, springs and loads are limited only by '//
+ 'the available memory and disk storage capacity.',LX,LY)

To send graphics to the RIGHT UPPER Widget screen pane, I have used
CALL setxid(idDRW,'WIDGET')
CALL metafl('CONS') !Graphic page goes to screen
...followed by a lot of calls like this:
CALL LINWID(NINT(Thickness))
CALL COLOR('GRAY')
CALL RLINE(x1,y1,x2,y2) ! Within the CALL GRAF range


My problem

WINDOWS VERSION
When I run the compiled executable under Windows, the screen looks,
as intended, like screenshot Win01.

It has some 'HELP' text displayed in the RIGHT-UPPER pane.

Then, after pulling down a file-opening menu in my application and opening a data file, the screen looks as intended,
like screenshot Win02.

The LEFT UPPER pane displays the input data.
The RIGHT-UPPER pane displays an image of a structural frame.

LINUX VERSION
When I run the compiled executable under Linux, the screen looks,
not as intended, like screenshot Lin01-Startup1.

The intended 'HELP' text is displayed, but it is not in the UPPER RIGHT pane as intended.
It fills the whole program window.  After I click the RMB, the display changes to Lin01-Startup2.

When I then open a file, the display changes to look like Screenshot Lin02.
If I pull down a program menu and select a program function to change the display slightly, I can make it show Lin03.

HELP REQUEST
I am using the exact same code in both the Windows and Linux versions, and both use Dislin.  It is excellent that the same code compiles first time when ported to Linux but I was therefore also expecting Lin01 and Lin02 to look the same as Win01 and Win02, respectively.  I would very greatly appreciate any help anyone can offer me about what I might be doing wrong here, because my Linux output is not at all right.

--- 
John Wasilewski

Win01 Startup.jpg
Win02 FileOpened.jpg
Lin01 Startup1.jpg
Lin01 Startup2.jpg
Lin02 FileOpened.jpg
Lin03 ChangedDisplay.jpg

Helmut Michels

unread,
May 27, 2014, 2:42:15 AM5/27/14
to dislin...@googlegroups.com
Hi John,

the title content 'DISLIN 1 / Click MB2 or MB3 to continue' in Lin01 Startup.jpg means that the text is
displayed in a Dislin graphics window and not in a draw widget. This happens when you try to plot something
to a draw widget before the widget is realized. Widgets are normally realized for X11 in the routine WGFIN, so
that you can plot to draw widgets in callback routines. If you want to plot to draw wdigets before WGFIN, you
can call the routine REAWGT for realizing the widget tree. Realizing the widget tree is only necessary for X11,
but not for Windows, where each widget is already realized (shown) in the widget routine.

Best regards,

Helmut

John Wasilewski

unread,
May 27, 2014, 1:46:16 PM5/27/14
to dislin...@googlegroups.com
Your reply is very helpful Helmut, so thank you very much.
Such a fast response as well.  Greatly appreciated!

Near the start of my code, where setting up the program GUI window, and before sending text or vectors to the program window text and graphic panes, I made the following one-line addition:

      CALL SWGATT(idDRW,'ACTIVE','STATUS')
      CALL REAWGT ! <------ This line added, here, near the start

      CALL setxid(idDRW,'WIDGET')
      CALL metafl('CONS') !Graphic page goes to screen

      CALL disini

Result: the Linux version now looks almost the same as the Windows version. 

I notice that, inserting the same line into the code in the Windows version seems to make no difference, which is good because it means I don't need different versions of the program source files.  The exact same source code now produces the same results under Windows and under Linux.

So thank you again.
--- 
Yours sincerely,
John

--
You received this message because you are subscribed to the Google Groups "dislin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dislin-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages