FLTK logo

Re: [fltk.general] fluid question, gnome-terminal worked, sh didn't

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: fluid question, gnome-terminal worked, sh didn't Gaurav Saxena May 01, 2006  
 
Hi Greg,

Greg Ercolano wrote:


    Hmm, try just setting the fluid shell command to:

sh -c '( if make test; then ./test; fi) 2>&1'

    That should work. You should be able to see all output
    in fluid's own terminal window.

When I used the sh statement above, I didn't get the output of the program *at event-time* but at *program completion*. Here's what I get when I used alt+g:

sh -c '(if make; then ./main; fi) 2>&1'
#Fluid generates the UI code(without the named pipe code).
#Diff then informs of changes between makeGUI.h/.cxx and
#ControlInterface.h/.cxx, the code of latter is updated accordingly
# and is used below.
mpiCC -g -Wall \
 	-I/usr/local/include -I/usr/X11R6/include -I/usr/local/fltk-1.1.7 \
 	-o main makeGUI.cxx ControlGL.cxx negc_comm.c\
-L/usr/local/lib -L/usr/X11R6/lib -lfltk -lm -lGL -lsupc++ /usr/local/lib/libfltk.a /usr/local/lib/libfltk_gl.a
#done-----------------------------
#Compiling master --------------------
mpicc -g \
-I/usr/local/include -I/usr/X11R6/include -I/usr/local/fltk-1.1.7 \
-L/usr/local/lib -L/usr/X11R6/lib -lfltk -lm -lGL -lsupc++ /usr/local/lib/libfltk.a /usr/local/lib/libfltk_gl.a \
-o master mastermpi.c negc_mpi.c
#done-----------------------------

There's a Quit Button, when I hit it, that's when I see the correct outputs appended in the window:

Init Callback started
Init Callback started
Go Callback
Go Callback
Go Callback
Go Callback
Go Callback
Quit Callback
... END SHELL COMMAND ...

This is all happening in the Shell Command window. For some reason the output is queued and displayed when the program ends, this is my observation. I cannot justify it though. From your video I felt this wasn't the expected behaviour, do you think its because I'm coding on linux ?

    If you really want it to run in a gnome-terminal (why? just curious)
    then you can still make it a "one liner" fluid shell command:

gnome-terminal -x sh -c '(if make; then ./test; fi; cat) 2>&1'


Oh, I forgot about sh, found that the little gnome icon for opening a terminal was pointing to gnome-terminal so used it. although I think it might be linked to sh under the hood.

Ah, but the intended output did come when I used the gnome-terminal command. I would like to know the cause for this. This time I did get the output(as I pressed the buttons), but it was in a seperate terminal and not in fluid's shell command window.

Greg, I couldn't find the advanced tutorial for classes in fluid. I couldn't find it on seriss either. Could you let me know the link for it?


    It ain't done yet.

It's been scheduled for the 'not too distant future' for a few years now.. ;)
    I just haven't had any free time to do it.

Standing by.. btw, really good tutorial for fluid. I'm sure people are earnestly waiting for the next episode.

Thanks and best,

Gaurav

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.