Re: How can I find out what is the gtk development version?

2008-04-10 Thread ying lcs
On Thu, Apr 10, 2008 at 11:28 AM, Tomas Carnecky <[EMAIL PROTECTED]> wrote:
> ying lcs wrote:
>
> > On Thu, Apr 10, 2008 at 11:12 AM, Kevin DeKorte <[EMAIL PROTECTED]>
> wrote:
> >
> > > -BEGIN PGP SIGNED MESSAGE-
> > >  Hash: SHA1
> > >
> > >
> > >  ying lcs wrote:
> > >  | Hi,
> > >  |
> > >  | How can I find out what is the gtk development version that I am
> using
> > >  on linux?
> > >
> > >
> > >  ~ pkg-config --modversion gtk+-2.0
> > >
> > >
> > >  Should give you the version
> > >
> > >  Kevin
> > >
> > >
> >
> > Thanks you. I just did it, but I get:
> >
> > # pkg-config --modversion gtk+2.0
> > Package gtk+2.0 was not found in the pkg-config search path.
> > Perhaps you should add the directory containing `gtk+2.0.pc'
> > to the PKG_CONFIG_PATH environment variable
> > No package 'gtk+2.0' found
> >
> > But I am running gnome, so I must have gtk+.
> >
> > Is that a setting issue?
> >
> >
>
>  err.. try this:
>
>
>  pkg-config --modversion gtk+-2.0
>
>  (it's $package-$version and the package is 'gtk+' and version '2.0', hence
> you get 'gtk+-2.0', the '+-' can be a bit confusing)
>
>  tom
>
Thank you. I got it.

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


Re: How can I find out what is the gtk development version?

2008-04-10 Thread ying lcs
On Thu, Apr 10, 2008 at 11:12 AM, Kevin DeKorte <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
>  Hash: SHA1
>
>
>  ying lcs wrote:
>  | Hi,
>  |
>  | How can I find out what is the gtk development version that I am using
>  on linux?
>
>
>  ~ pkg-config --modversion gtk+-2.0
>
>
>  Should give you the version
>
>  Kevin
>

Thanks you. I just did it, but I get:

# pkg-config --modversion gtk+2.0
Package gtk+2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+2.0' found

But I am running gnome, so I must have gtk+.

Is that a setting issue?



>  - --
>  Get my public GnuPG key from
>  http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
>  -BEGIN PGP SIGNATURE-
>  Version: GnuPG v1.4.9 (GNU/Linux)
>  Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>
>  iEYEARECAAYFAkf+PH4ACgkQ6w2kMH0L1dFezACeMiFfnZ/gpgbfgfdr7HJ5jEQT
>  br0An0AuV9BJs3dpTLlU6bCKHuwCjRe+
>  =CNc6
>  -END PGP SIGNATURE-
>
___
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 find out what is the gtk development version?

2008-04-10 Thread ying lcs
Hi,

How can I find out what is the gtk development version that I am using on linux?

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: Question in using gdk_pixbuf_get_from_drawable()

2008-03-30 Thread ying lcs
Yes, I am really accessing a GDK window.

  pb = gdk_pixbuf_get_from_drawable(NULL,
GDK_DRAWABLE(window),


Any other idea?

Thanks.

On Sun, Mar 23, 2008 at 11:34 AM, Luis Menina <[EMAIL PROTECTED]> wrote:
> Are you really sure you're accessing the GdkWindow and not the GtkWindow ?
>
>  GtkWindow *toplevel = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>
>  [add some graphical stuff in that GtkWindow]
>
>  /* and then, later on... */
>  GdkWindow *window = toplevel->window;
>
>
>  if (window != NULL)
>  {
>  int x, y, width, height, depth;
>  GdkPixbuf *pb;
>
>
>  gdk_window_get_geometry (window, &x, &y, &width, &height, &depth);
>
>  pb = gdk_pixbuf_get_from_drawable(NULL,
>GDK_DRAWABLE (window),
>NULL, 0, 0, 0, 0, width, height);
>
>  gdk_pixbuf_save(pb, filename, "png", NULL,
>  "compression", "9",
>  NULL);
>  }
>
>  ying lcs a écrit :
>
>
> > Luis,
>  >
>  > The 'window' object is from:
>  >
>  >  gtk_window_new(GTK_WINDOW_TOPLEVEL)
>  >
>  > I do see it works something, while other times, I see the screenshot
>  > get out of place (as shown in the image I attached).
>  >
>  > I suspect my window is obscured during the capture.
>  >
>  > So how can I programmatic make sure my window is not obscured before
>  > the catpure?
>  >
>  > I have tried adding:
>  >
>  >  gdk_window_raise(window);
>  >  gdk_flush();
>  >
>  >
>  > But it does not always help.
>  >
>  > Thank you for any more pointers.
>  >
>  >
>  >
>  >
>  > On Thu, Mar 20, 2008 at 7:37 PM, Luis Menina <[EMAIL PROTECTED]> wrote:
>  >> Hi,
>  >>
>  >>  where does your "window" object come from ? Could you please give us the
>  >>  code where you initilized it ? I've tried to adapt your code in a simple
>  >>  example, and it just works... I get a screenshot of what is in the
>  >>  window, without the window decoration.
>  >>
>  >>  Cheers,
>  >>
>  >>  Luis
>  >>
>  >>  ying lcs a écrit :
>  >>
>  >>
>  >>> Hi,
>  >>  >
>  >>  > I have a question of using gdk_pixbuf_get_from_drawable(). I have the
>  >>  > following code which save the gdk window to a png file.
>  >>  > But something I get something which is totally not what is displayed
>  >>  > on the window. Can you please tell me what am I missing?
>  >>  >
>  >>  > GdkWindow *window ;
>  >>  >
>  >>  > if (window != NULL) {
>  >>  >
>  >>  >   int x, y, width, height, depth;
>  >>  >
>  >>  >   gdk_window_get_geometry( window, &x, &y, &width, &height, &depth 
> );
>  >>  >
>  >>  >   printf (" width=%d, height=%d\n", width, height);
>  >>  >
>  >>  >   /* copy the pixmap from the treeview and from the title */
>  >>  >   pb = gdk_pixbuf_get_from_drawable(NULL,
>  >>  >   GDK_DRAWABLE(window),
>  >>  >   NULL, 0, 0, 0, 0, width, height);
>  >>  >
>  >>  >
>  >>  >   /* save the pixbuf to a png file */
>  >>  >   gdk_pixbuf_save(pb, filename, "png", NULL,
>  >>  > "compression", "9",
>  >>  > NULL);
>  >>  > }
>  >>  >
>  >>  > Thank you.
>  >>  >
>  >>  >
>  >>  > 
> 
>  >>  >
>  >>  > ___
>  >>  > gtk-app-devel-list mailing list
>  >>  > gtk-app-devel-list@gnome.org
>  >>  > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>  >>
>  >
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Question in using gdk_pixbuf_get_from_drawable()

2008-03-22 Thread ying lcs
Luis,

The 'window' object is from:

 gtk_window_new(GTK_WINDOW_TOPLEVEL)

I do see it works something, while other times, I see the screenshot
get out of place (as shown in the image I attached).

I suspect my window is obscured during the capture.

So how can I programmatic make sure my window is not obscured before
the catpure?

I have tried adding:

 gdk_window_raise(window);
 gdk_flush();


But it does not always help.

Thank you for any more pointers.




On Thu, Mar 20, 2008 at 7:37 PM, Luis Menina <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  where does your "window" object come from ? Could you please give us the
>  code where you initilized it ? I've tried to adapt your code in a simple
>  example, and it just works... I get a screenshot of what is in the
>  window, without the window decoration.
>
>  Cheers,
>
>  Luis
>
>  ying lcs a écrit :
>
>
> > Hi,
>  >
>  > I have a question of using gdk_pixbuf_get_from_drawable(). I have the
>  > following code which save the gdk window to a png file.
>  > But something I get something which is totally not what is displayed
>  > on the window. Can you please tell me what am I missing?
>  >
>  > GdkWindow *window ;
>  >
>  > if (window != NULL) {
>  >
>  >   int x, y, width, height, depth;
>  >
>  >   gdk_window_get_geometry( window, &x, &y, &width, &height, &depth );
>  >
>  >   printf (" width=%d, height=%d\n", width, height);
>  >
>  >   /* copy the pixmap from the treeview and from the title */
>  >   pb = gdk_pixbuf_get_from_drawable(NULL,
>  >   GDK_DRAWABLE(window),
>  >   NULL, 0, 0, 0, 0, width, height);
>  >
>  >
>  >   /* save the pixbuf to a png file */
>  >   gdk_pixbuf_save(pb, filename, "png", NULL,
>  > "compression", "9",
>  > NULL);
>  > }
>  >
>  > Thank you.
>  >
>  >
>  > 
>  >
>  > ___
>  > gtk-app-devel-list mailing list
>  > gtk-app-devel-list@gnome.org
>  > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Question in using gdk_pixbuf_get_from_drawable()

2008-03-20 Thread ying lcs
Hi,

I have a question of using gdk_pixbuf_get_from_drawable(). I have the
following code which save the gdk window to a png file.
But something I get something which is totally not what is displayed
on the window. Can you please tell me what am I missing?

GdkWindow *window ;

if (window != NULL) {

  int x, y, width, height, depth;

  gdk_window_get_geometry( window, &x, &y, &width, &height, &depth );

  printf (" width=%d, height=%d\n", width, height);

  /* copy the pixmap from the treeview and from the title */
  pb = gdk_pixbuf_get_from_drawable(NULL,
GDK_DRAWABLE(window),
NULL, 0, 0, 0, 0, width, height);


  /* save the pixbuf to a png file */
  gdk_pixbuf_save(pb, filename, "png", NULL,
  "compression", "9",
  NULL);
}

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

How to use 'gdk_pixbuf_get_from_drawable'

2008-03-19 Thread ying lcs
Hi,

I am trying to use 'gdk_pixbuf_get_from_drawable' to capture screen
shot from a gdk window.

Can you please tell me if I need to grab a semphore lock for the
window (so that nothing is being painted) before I call that function
gdk_pixbuf_get_from_drawable() to capture the pixbuf?

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


[no subject]

2008-02-29 Thread ying lcs

___
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 find out the current font size

2008-01-11 Thread ying lcs
Hi,

When I use this function to paint text, can you please tell me how can
I find out the font size of the text.

voidgdk_draw_layout (GdkDrawable *drawable,
 GdkGC *gc,
 gint x,
 gint y,
 PangoLayout *layout);

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


How to scroll my gtk application window programmically

2007-11-14 Thread ying lcs
Hi,

I would like to know how can I scroll my gtk application window programmically?

I have tried this, but the scroll bar does not make and the content of
the window did not get refresh?

GtkWidget* topLevelWindow;
 GdkWindow* win = topLevelWindow->window;

 gdk_window_scroll (win, 1, 880);


Thank you for any help.
___
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