Re: How can I tell if a GTKWidget is realized?

2007-11-10 Thread Brian J. Tarricone
On Fri, 9 Nov 2007 14:40:53 -0600 ying lcs wrote:

> Can you please tell me how can I tell programmically if a GTKWidget
> is realized?

http://library.gnome.org/devel/gtk/stable/GtkWidget.html#GTK-WIDGET-REALIZED:CAPS

-brian
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How can I tell if a GTKWidget is realized?

2007-11-10 Thread ying lcs
Hi,

Can you please tell me how can I tell programmically if a GTKWidget is realized?

Thank you.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Fwd: gnome applet w/ bash

2007-11-10 Thread Matteo Landi
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
> > > > > > > >

Re: Vector drawing question.

2007-11-10 Thread Jon Harrop
On Wednesday 07 November 2007 21:29, Vadim Gutnik wrote:
> Should I be looking at some other toolkit or package for this?

Smoke Vector Graphics provides hardware-accelerated 2D vector graphics with a 
declarative scene graph description:

  http://www.ffconsultancy.com/products/smoke_vector_graphics/?gtk

You might also try Cairo, although it is a lot slower:

  http://cairographics.org/bindings/

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: HICON to GdkPixbuf

2007-11-10 Thread Andrew Smith
Tor Lillqvist a écrit :
 >> Does anyone have ideas about how to convert such an HICON to a 
GdkPixbuf?
 >
 > There is code in gdk/win32 to do that, check the function
 > gdk_win32_icon_to_pixbuf_libgtk_only() in gdk/win32/gdkcursor-win32.c
 > in GTK+. This is an internal function so you aren't supposed to call
 > it. But as it is in libgdk, and is called by libgtk, it is in fact
 > exported, so you *can* call it. Include  for the
 > prototype.
 >
Thanks, that worked.

 > Actually, I guess one could argue this is a useful function that
 > should exist as a public (even if platform-specific) API, in
 > libgdk-pixbuf.
 >
Indeed! There's a whole serious image decoder in there, would even be 
nice if it were in its own library :)

Andrew


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list