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 gdk/gdkwin32.h 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


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: 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 sys/utsname.h
  
  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
   
On 05/11/2007, Matteo Landi [EMAIL PROTECTED] wrote:
 thank you very much, that solved one of my problems.
 here is the second:
 i'm using a pipe to catch the output of a specific command 
 and store it
 as a label in the panel; the problem is that if the array 
 containing the
 output is smaller than the output itself, the line is cut, 
 and the
 applet is show all middle aligned; if the output is bigger, i 
 get the
 label splitted in two lines: the first one containing the 
 entire output,
 and the second one is empty.
 How could i solve this? 

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: 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


Patch review: sizing toggle cell renderers based on font size

2007-11-10 Thread Ross Burton
Hi,

http://bugzilla.gnome.org/show_bug.cgi?id=459997 contains a patch we're
shipping in Poky (pokylinux.org) to size the toggle cell renderer check
boxes to roughly the height of the font instead of hard-coding it at
12px.  A 12px check box is a little tricky to use on a screen with 200+
dpi. :)

I'd appreciate a review of this, we've got far too many patches at the
moment.

Ross
-- 
Ross Burton mail: [EMAIL PROTECTED]
  jabber: [EMAIL PROTECTED]
 www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF


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


Re: [PATCH]: Fix SIGBUS in JPEG handling on RISC

2007-11-10 Thread Matthias Clasen
On Nov 7, 2007 10:29 PM, David Miller [EMAIL PROTECTED] wrote:
 From: Owen Taylor [EMAIL PROTECTED]
 Date: Sat, 03 Nov 2007 21:16:38 -0400

  On Sat, 2007-11-03 at 15:50 -0700, David Miller wrote:
   Alternatively, we can say that GTK+ knows better and simply
   block out such dumb platforms at the top-level configure :-)
 
  Plus you don't want to trap it's going to be slow and might
  even fill up the user's logs. (This used to be a problem on Alpha Linux
  long a
 
  Grep for ' 8' in the gdkpixbuf sources and you'll find a small
  fraction of the other places where we go through effort avoid unaligned
  access.

 I'm glad that people agree with me. :)

 Meanwhile, could someone please apply my patch so that this bug gets
 fixed?


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


Re: pangocairo show_glyph_string vs. glyph_string_path

2007-11-10 Thread Leon Woestenberg
Hello Behdad,

thanks for the explanation.

Behdad Esfahbod wrote:
 On Fri, 2007-11-09 at 23:14 +0100, Leon Woestenberg wrote:
   
 in one application I try to use pango_cairo_glyph_string_path() so
 that I can specify subsequent fill and stroke.
 
 You don't seem to be positioning the runs at all.

 Guessing at what you want to do, you have two options:

   - Use pango_cairo_layout_path().
   
My application is this: I have an umlimited amount of text streaming in, 
of which I do not know the contents beforehand,
as they are created dynamically. Think of a stock ticker bar, or a news 
headlines bar scrolling by horizontally, or
vertically, like in a movies credits screen.

I want to layout this text on the screen piecewise, but also be able to 
add visual effects to each glyph appearing.
   - If you really want to handle each run separately, subclass
 PangoRenderer and let pango deal with positioning runs and call back
 your method to render each run.
   
I'll look into this. Is there any sample code this does this?

This is my first attempt with pangocairo, I'm using it so that my 
application supports all the world lingua/scripts (ideally).

Thanks Behdad and all for all your effort in this,

Best regards,

Leon Woestenberg.
___
gtk-i18n-list mailing list
gtk-i18n-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-i18n-list


no device event controller found

2007-11-10 Thread Tomas KRAMAR
Hello,

I am developing an application using a gstreamer backend and pygtk.

I create the gstreamer bus and connect a message signal:
bus.connect('message', self.on_message)

However, several people reported, that self.on_message is never
called, and they see following warnings in the output:

atk-bridge-WARNING **: failure: no device event controller found.

I thought this is something related to gstreamer and already asked on
their mailing list, but they told me the warning has nothing to the
with gstreamer, but rather with atk.

I'd like to know what is causing this error, and what is the way to
fix it. Is there some package missing?

Thank you

Regards
Tomas
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Question regarding GdkPixmap struct

2007-11-10 Thread anurag sogal
Hello Everybody,

I reviewed the code for scribble.c program which uses a backing pixmap
to store the what ever is drawn. However when I browsed through the .h
files such as gdkpixmap.h and gdk.h , there was no structure like
GdkPixmap. The documentation says that it is an opaque structure.
Whats does that mean?

The reason why I want to know what is inside it is because I want to
use the values within the structure of GdkPixmap to recreate a pixmap
on a remote machine.

Can somebody tell me where I can find the details of this structure
also can how can I use these values (that I have obtained from within
the structure to re-create the pixmap.

Thanks
Anurag
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Question regarding GdkPixmap struct

2007-11-10 Thread Paul Davis
On Sat, 2007-11-10 at 13:35 -0500, anurag sogal wrote:
 Hello Everybody,
 
 I reviewed the code for scribble.c program which uses a backing pixmap
 to store the what ever is drawn. However when I browsed through the .h
 files such as gdkpixmap.h and gdk.h , there was no structure like
 GdkPixmap. The documentation says that it is an opaque structure.
 Whats does that mean?

Pixmaps are server-side objects. the client (your app) has no access to
them.

 
 The reason why I want to know what is inside it is because I want to
 use the values within the structure of GdkPixmap to recreate a pixmap
 on a remote machine.
 
 Can somebody tell me where I can find the details of this structure
 also can how can I use these values (that I have obtained from within
 the structure to re-create the pixmap.

you will want to use a GdkPixbuf instead, which is a client-side object
that has pixel values that you can actually read.

it, like GdkPixmap, is a GdkDrawable, and so can be used for all the
same things that a GdkPixmap can.


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


gnome applet

2007-11-10 Thread Matteo Landi
hi all
i'm trying to develope a little gnome applet.
the tutorial i found with google, show me a way to create the applet
using the bonobo callback function.
Could you tell me something more about this method? how should i code in
order to free all the memory allocated when the applet is going to be
close? i notice that after testing my applet over and over again, my
memory seems to full itself.. (that's strange)
tnx in advance

M@

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


How can I scroll my gtk application window programmically?

2007-11-10 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-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Gtk2 1.162 available

2007-11-10 Thread Torsten Schoenfeld
Overview of changes in Gtk2 1.162
=

* Fix a strange parse error related to the use of qw// that occured on some
  versions of perl.  [Jeffrey Ratcliffe]

The source code is available from the gtk2-perl project page on  
sourceforge:

http://downloads.sourceforge.net/gtk2-perl/Gtk2-1.162.tar.gz

...and from anonymous cvs, tagged rel-1-16-2 in the directory  
/gtk2-perl-xs/Gtk2.

This module requires these other modules and libraries:

   perl = 5.8.0
   Glib = 1.160 (perl module)
   GTK+  2.x (C library and prerequisites)

If GTK+ is as new or newer as 2.8, the Cairo module is also required:

  Cairo = 1.00 (Perl module)

In order to build it from source, you'll also need

   ExtUtils::Depends = 0.2
   ExtUtils::PkgConfig = 1.03
   development headers for gtk+ and friends

Gtk2 is a Perl extension providing Perl bindings to the 2.x series of  
the Gtk+ graphical user interface library.  This module allows you to  
write graphical user interfaces in a perlish and object-oriented way,  
freeing you from the casting and memory management in C, yet remaining 
very close in spirit to original API.  Find out more about Gtk+ at 
http://www.gtk.org, and about Gtk2-Perl at 
http://gtk2-perl.sourceforge.net/.


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