Code::Blocks Forums

User forums => Help => Topic started by: kmallick2000 on January 12, 2017, 06:42:43 am

Title: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 12, 2017, 06:42:43 am
In Windows 10, I am trying to use the Tools to pipe the output from a Fortran code into the console. The program compiles fine and runs as intended. However, when I use the Tools to pipe the output, the graphical content (plots, charts etc) of the dislin (http://www.mps.mpg.de/dislin (http://www.mps.mpg.de/dislin)) do not show at all, while the program runs in a hidden mode. I have to kill the process before I can run it again.

Attached is a screenshot from my setup for the Tools menu as suggested in the past and it seems to be working for the verbose output into stdout. But no luck with the graphical part.

BTW, the same setup works beautifully in Linux (Leap 42.1). The Tools output works great including the graphical content from dislin.

Any help with figuring my problem out in Windows 10 set up for C::B would be greatly appreciated.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: oBFusCATed on January 12, 2017, 09:58:35 am
Have you tried the other launching options?
Title: Re: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 13, 2017, 04:46:19 pm
It launches fine if I do Run or Build and Run from the top menu.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: oBFusCATed on January 13, 2017, 09:16:57 pm
I'm talking about the radio buttons in the screenshot you've attached.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 16, 2017, 05:00:18 pm
ooops, I am sorry, Yes I tried all of the different combinations. some combos work as intended by outputting to an external console. but no luck in the way I want it to work. standard outout to the console inside and GUI as intended.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: stahta01 on January 16, 2017, 05:05:44 pm
ooops, I am sorry, Yes I tried all of the different combinations. some combos work as intended by outputting to an external console. but no luck in the way I want it to work. standard outout to the console inside and GUI as intended.

IIRC, That is because you are on Windows.

Tim S.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 16, 2017, 08:02:14 pm
I don't understand why. Another IDE Netbean allows that fine.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: BlueHazzard on January 17, 2017, 11:19:26 am
For me it is not clear what you want to do...
can you please explain in a step by step guide what do you want to do?
As far as i understand you want to run your compiled program trough the Tools plugin?
If you run the program trough Project->Run it runs fine, but if you run it trough Tools->Your program what happens?
What kind of output windows do you get? Ncurses, native mfc, qt?
Title: Re: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 17, 2017, 05:01:09 pm
Sorry for not being clear.

The main goal is to run my program without a separate console showing. Currently when I compile and run my code, I get a console output as well as a graphic output that uses the dislin routines. For example it shows a graphic plot as shown in the attached screen capture, while opening an external console at the same time:

I would like to pipe any output from the program in to an internal console (as opposed to an external console), but have the graphic output showing externally.

Currently, the Tools menu in Windows do not output anything, but keeps running in the background.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: BlueHazzard on January 17, 2017, 07:46:22 pm
i am afraid, but i don't think cb can do this.

There is no native functionality to put the output into a c::b internal window. One possibility is as you have found the tools plugin.
You can also try the Tools+ plugin, but i don't think this will help you...

Why is this not possible? Simply: no one has implemented it, because no one (or at least no cb developer) until now has a need for it.

Maybe there is some workaround i don't know...
Title: Re: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 18, 2017, 04:15:39 am
There has been posts in the past that claimed this is possible and the feature needs to be accessed through the Tools menu.

http://forums.codeblocks.org/index.php?topic=13175.0

As I mentioned that it works fine in Linux, but not in Windows 10.

It seems to be a pain to make the C::B output appear in the internal console. Other IDEs like Netbeans and Eclipse do it without monkeying around.

Title: Re: cannot get graphical output from dislin using Tools output
Post by: oBFusCATed on January 18, 2017, 09:13:38 am
It seems to be a pain to make the C::B output appear in the internal console. Other IDEs like Netbeans and Eclipse do it without monkeying around.
Have you tried the other IDEs on Windows? Windows is a bit special when console applications are involved or when gui applications show a console themselves.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 18, 2017, 04:49:38 pm
Thanks again for trying to help.
Yes, outputting to an internal console is the default in NetBeans running in Windows. My program works exactly as I intended in NetBeans. I was hoping to move to C::B for its added features.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: BlueHazzard on January 19, 2017, 10:56:30 am
i tried to find the code responsible for calling the programs and piping the output, but dammmmmm is java a pile of code and folders.... and full of files with 10 lines of only setter and getter....
any help to pointing in the right direction would be nice...
Title: Re: cannot get graphical output from dislin using Tools output
Post by: kmallick2000 on January 19, 2017, 04:53:30 pm
I am sorry I don't understand what you had asked for. I would love to help/assist.
Title: Re: cannot get graphical output from dislin using Tools output
Post by: sodev on January 19, 2017, 07:21:24 pm
Uhm, CodeBlocks isn't written in Java, not sure how much it helps to figure out how to do it in Java ;D. Basically you need to grab the standard streams from the child process and read/write from/to them, depending which API you use (popen, CreateProcess, etc.) this works differently.

Luckily wxWidgets has encapsulated this in wxProcess, but it looks like there is no other way to do it than polling :(.