Just another question..
what is the right way to fix the functions for closing the applet? i
noticed that if i shutdown the cpu and i've got the applet running, it
freezes waiting for killing remaining process; after that i gotta shut
it down manually using the front button..
what is the close function i gotta call for closing applet rised up with
bonobo?
tnx again
M@
On Wed, 2007-11-07 at 01:07 +0100, Matteo Landi wrote:
> well
> thank you so much for the help you gave me
> i created my first gnome applet (there is also a cpu graph) and it looks
> very good!
> M@
>
> On Mon, 2007-11-05 at 23:50 +1100, Michael Lamothe wrote:
> > Oh dear,
> >
> > #include
> >
> > struct utsname name;
> > uname(&name);
> > printf("%s\n", name.sysname);
> > printf("%s\n", name.nodename);
> > printf("%s\n", name.release);
> > printf("%s\n", name.version);
> > printf("%s\n", name.machine);
> >
> > Thanks,
> >
> > Michael
> >
> >
> > On 05/11/2007, Matteo Landi <[EMAIL PROTECTED]> wrote:
> > >
> > > On Mon, 2007-11-05 at 22:55 +1100, Michael Lamothe wrote:
> > > > Hi Matteo,
> > > >
> > > > I'm not following. What box? A GtkBox? What "row"?
> > >
> > > they are just examples
> > >
> > > > Have you thought of using Glade to do your UI work?
> > >
> > > the fact is that i've started working with gtk two days ago because i
> > > was interested in make a gnome panel monitor, and in the tutorial i've
> > > found, i create a panel with the bonobo inititialization..
> > > i dont know if i can do this even with glade..
> > >
> > > Talking about the spawn, i think the problem is due to the command
> > > itself (uname) that at the end print a "\n"; So i gotta throw away that
> > > char from the string to obtaine a one line label, isn't it?
> > >
> > > M@
> > >
> > > > Thanks,
> > > >
> > > > Michael
> > > >
> > > > On 05/11/2007, Matteo Landi <[EMAIL PROTECTED]> wrote:
> > > > > ok ok that worked, but the output is the same as before...
> > > > >
> > > > > just try to create a box with two labels inside:
> > > > >
> > > > > one createt with label = gtk_label_new ("foo");
> > > > > and the other created with label = gtk_label_new (std_output);
> > > > >
> > > > > i got the foo one middle aligned and the second placed on the top of
> > > > > the
> > > > > row.. am i wrong?
> > > > >
> > > > > M@
> > > > >
> > > > > On Mon, 2007-11-05 at 22:06 +1100, Michael Lamothe wrote:
> > > > > > Your pseudo makes no sense, how can you pass a char * into
> > > > > > parameter 2
> > > > > > of g_spawn_command_line_sync() when its a gchar**. This worked for
> > > > > > me,
> > > > > >
> > > > > >
> > > > > > gchar* std_output = NULL;
> > > > > > g_spawn_command_line_sync("ls -al", &std_output, NULL, NULL,
> > > > > > NULL);
> > > > > > printf(std_output);
> > > > > >
> > > > > > Thanks,
> > > > > >
> > > > > > Michael
> > > > > >
> > > > > >
> > > > > > On 05/11/2007, Matteo Landi <[EMAIL PROTECTED]> wrote:
> > > > > > > Tnx i think that the first one is the function i'm in need of; by
> > > > > > > the
> > > > > > > way i cant' make it work, and my gnome panel crashs everytime i
> > > > > > > run the
> > > > > > > applet, so i think there is some problems with memory:
> > > > > > > well, i've got:
> > > > > > > const char* data (as argoment of a function)
> > > > > > > char *std_out (created in the function)
> > > > > > >
> > > > > > > g_spawn_command_line_sync(data, std_out, NULL, NULL, NULL);
> > > > > > >
> > > > > > > is this call right? i think not...but why??
> > > > > > >
> > > > > > > tnx again
> > > > > > > M@
> > > > > > >
> > > > > > > On Mon, 2007-11-05 at 15:21 +1100, Michael Lamothe wrote:
> > > > > > > > Hi Matteo,
> > > > > > > >
> > > > > > > > There's a few ways to do this, two of which I'll tell you now.
> > > > > > > > Hopefully, you can change your application to use these
> > > > > > > > functions
> > > > > > > > instead.
> > > > > > > >
> > > > > > > > Firstly, there's the g_spawn_ set of APIs designed for this. I
> > > > > > > > think
> > > > > > > > that something like g_spawn_command_line_sync() will do exactly
> > > > > > > > what
> > > > > > > > you want. Basically, GLib calculates and allocates the space
> > > > > > > > required. The documentation mentions nothing about freeing the
> > > > > > > > allocated strings afterwards but I imagine you will have to
> > > > > > > > free the
> > > > > > > > standard_output and standard_error parameters with g_free().
> > > > > > > >
> > > > > > > > Secondly, if the spawned program is meant to run asynchronously
> > > > > > > > in the
> > > > > > > > background then you'll need to use something like
> > > > > > > > g_spawn_async_with_pipes(). I don't think that this is what
> > > > > > > > you want
> > > > > > > > because you were talking about having to allocate the length of
> > > > > > > > the
> > > > > > > > output.
> > > > > > > >
> > > > > > > > Thanks,
> > > > > > > >
> > > > > > > > Michael
> > > > > > > >