Re: maybe known, maybe not...

On Sun, Jan 08, 2012 at 01:55:16PM +0000, jcupitt gmail com wrote:
Date: Sun, 8 Jan 2012 13:55:16 +0000
From: jcupitt gmail com
Subject: Re: maybe known, maybe not...
To: Gary Kline <kline thought org>
Cc: GTK Devel List <gtk-app-devel-list gnome org>

Hi Gary,

On 8 January 2012 02:49, Gary Kline <kline thought org> wrote:
o am trying to have a "run" button fork off a new gvim and increase
a global counter after the first gvim is closed.  my main gtk goes
dark and nothing responds in this case.  i don't know if every

If you do this:

  system("gvim stuff.txt");

system() will block until the vim exits, and while system() is
blocked, your gtk application will not be handling events (like

A simple fix is to append a "&" so that the vim runs in the background:

  system("gvim stuff.txt &");

Now the system() will return immediately and your gtk program can
carry on working while the gvim runs.

        i'll try it, thanks.

        i also have two "sleep(1);" in the code.  i'm trying to slow
        the program down, if i remember correctly.  i'm still too
        new to gtk, and so am almost coding blind.

        [[i do have what i want; but with the main application dark,
        i'm stuck!]]

If you want something to stop the user launching 100s of gvims you
need to do a bit more work.

        hm.  no, i wait for the .talk.N.txt.swp file to be unlinked
        before any new gvim can fork-exec.   defensive work is



 Gary Kline  kline thought org  Public Service Unix
           Journey Toward the Dawn, E-Book:
          The 8.57a release of Jottings:
             Twenty-five years of service to the Unix community.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]