Re: pango package for win32 broken

2008-03-23 Thread Andreas Volz
Am Sun, 23 Mar 2008 00:57:32 +0200 schrieb Tor Lillqvist:

> >  The module directory is not present in the zip file.
> 
> The modules that are part of Pango are built-in in the corresponding
> DLLs.
> 
> >  Because of this no fonts are
> >  rendered and only a missing char (small box) is displayed for each
> > char.
> 
> That is caused by something else then. Do you get any error messages
> or warnings? What is the first one?
> 
> You could also try running some simple test program with the
> environment variable PANGO_WIN32_DEBUG set to some non-empty value and
> see if you get some hint from the output that generates. Preferably
> compare to what output you get on a machine where it works.

I made a mistake. For a short test I started the gtk-demo in wine on
Linux and hoped it might work. I missed to tell this (not unimportant)
in my E-Mail. :-)

Now I repeated the test in real windows and it works. But it's
interesting that it doesn't work with wine. Look here:

http://img525.imageshack.us/img525/3493/gtkdemowinegc7.jpg

and on the terminal:

(gtk-demo.exe:8): Pango-WARNING **: couldn't load font "Sans
Not-Rotated 10", falling back to "Sans Not-Rotated 10", expect ugly
output.

(gtk-demo.exe:8): Pango-WARNING **: All font fallbacks failed

(gtk-demo.exe:8): Pango-WARNING **: failed to find shape engine, expect
ugly output. engine-type='PangoRenderWin32', script='latin'

(gtk-demo.exe:8): Pango-WARNING **: All font fallbacks failed



(gtk-demo.exe:8): Pango-WARNING **: couldn't load font "Sans
Not-Rotated 18", falling back to "Sans Not-Rotated 18", expect ugly
output.


(gtk-demo.exe:8): Pango-WARNING **: All font fallbacks failed



(gtk-demo.exe:8): Pango-WARNING **: couldn't load font "Sans 10",
falling back to "Sans 10", expect ugly output.

(gtk-demo.exe:8): Pango-WARNING **: All font fallbacks failed

...

Any ideas what is missing to get it running in wine? I don't really
need it, because my app is available native on Linux, but it may be for
testing.

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


Re: toolButton Disable

2008-03-23 Thread Bastiaan Veelo
gtk_widget_set_sensitive() probably does what you want.

Regards,
Bastiaan.

Luiz Rafael Culik Guimaraes wrote:
> Dear Friends
>
> Is their an way to disable an specific tool buton like the winapi?
>
> I read the docs, but could not find an reference
>
> Regards
> Luiz
>   

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


Re: toolButton Disable

2008-03-23 Thread Luiz Rafael Culik Guimaraes
Hi Bastiaan


> gtk_widget_set_sensitive() probably does what you want.

thanks for answer, i'll look on this function docs

Regards
Luiz
___
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-23 Thread Luis Menina
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: Problem with references

2008-03-23 Thread Chris Vine
On Mon, 2008-03-17 at 10:16 +0100, Gabriele Greco wrote:
[snip]
> Actually I cover only the widgets I use in this app. I'm not using gtkmm
> mostly to avoid extra dependencies.
> 
> Anyway let's talk about the problem.
> 
> Gtk owns all toplevel windows.  It already does _ref_sink() on
> > GtkWindows on creation (see gtk_window_init() in gtk/gtkwindow.c).  In
> > this case, if you want to keep an extra reference to 'w', you'd just
> > call g_object_ref() on it.
> 
> 
> Ok, the problem is that I expected to be able to delete those top level
> windows with g_object_unref(), but it seems it's not enough, here is an
> example:
> 
> int main()
> {
> gtk_init(NULL, NULL);
> 
> GtkWidget *w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> 
> gtk_widget_show(w);
> 
> GtkWidget *d = gtk_message_dialog_new(NULL,
> GTK_DIALOG_MODAL,
> GTK_MESSAGE_INFO,
> GTK_BUTTONS_CLOSE,
> "Hello!");
> gtk_dialog_run(GTK_DIALOG(d));
> fprintf(stderr, "After run!\n");
> g_object_unref(d);
> fprintf(stderr, "After unref\n");
> 
> gtk_main();
> }
> 
> The message dialog is still opened after the unref, if I want to get rid of
> it I have to use gtk_widget_destroy() that is not what I want cause I may
> not be the owner of the object.
> 
> This should be ok as well, IFF you've previously called g_object_ref()
> > and thus own a reference to it.  As I said, Gtk owns the initial
> > (non-floating) reference GtkWindow that you get back with
> > gtk_window_new().
> 
> 
> Adding an additional reference to the dialog don't help me close it with
> g_object_unref()...
> 
> This more or less works (because non-window GtkObjects are created
> > floating), but that's usually not what you'd want to do.  Again you'd
> > probably want to just take a normal reference on the widget and then
> > unref it when you don't need it anymore.  When you add a widget to a
> > container, it will take care of ditching the floating reference and
> > taking a real reference.
> 
> 
> This is what I want and it works perfectly except for top level windows :)
> With toplevel windows I'm unable to get rid of them  with the same method I
> use with the other objects (g_object_unref), I can superclass it to do
> gtk_widget_destroy() if I see that the object count is 2 or less (since my
> reference is added to the initial one of GTK), but I'd like a cleaner way.

You cannot get rid of a top level window using g_object_unref() because
a reference is owned by GTK+.  It is not that it is "not enough", it is
that it is generally not the way to do it - you cannot generally get rid
of a widget that way, because other containers may own references.  It
is only really for use where you have yourself called g_object_ref() or
g_object_ref_sink() on it for your own purposes.

There is an explanation of this at:
http://library.gnome.org/devel/gtk/stable/GtkObject.html

If you want some light-weight lifetime wrappers for using GTK+ in a
program written in C++, this might give you some ideas, but gtkmm is
also a good choice:
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/gobj_handle.h
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/window.h
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/window.cpp
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/widget.h
http://efax-gtk.cvs.sourceforge.net/*checkout*/efax-gtk/efax-gtk/src/utils/widget.cpp

Chris


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