[gtk+] Update information about visuals
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Update information about visuals
- Date: Sat, 15 Jan 2011 01:46:25 +0000 (UTC)
commit d790fd4fdd3ea36c9ec38f6dd9b648487b9bfac7
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Jan 14 20:45:53 2011 -0500
Update information about visuals
Based on a patch by Jasper St. Pierre,
https://bugzilla.gnome.org/show_bug.cgi?id=639520
docs/reference/gtk/question_index.sgml | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/docs/reference/gtk/question_index.sgml b/docs/reference/gtk/question_index.sgml
index 9da5c00..b633a48 100644
--- a/docs/reference/gtk/question_index.sgml
+++ b/docs/reference/gtk/question_index.sgml
@@ -547,23 +547,24 @@ How do I create a transparent toplevel window ?
<answer>
<para>
To make a window transparent, it needs to use a visual which supports that.
-This is done by getting the RGBA colormap of the screen with
-gdk_screen_get_rgba_colormap() and setting it on the window. Note that
-gdk_screen_get_rgba_colormap() will return %NULL if transparent windows
-are not supported on the screen; also note that this may change from
-screen to screen, so it needs to be repeated whenever the window is moved
-to a different screen.
+This is done by getting the RGBA visual of the screen with
+gdk_screen_get_rgba_visual() and setting it on the window. Note that
+gdk_screen_get_rgba_visual() will return %NULL if transparent windows
+are not supported on the screen, you should fall back to
+gdk_screen_get_system_visual() in that case. Additionally, note that this
+will change from screen to screen, so it needs to be repeated whenever the
+window is moved to a different screen.
<informalexample><programlisting>
-GdkColormap *colormap;
+GdkVisual *visual;
-colormap = gdk_screen_get_rgba_colormap (screen);
-if (!colormap)
- colormap = gdk_screen_get_rgb_colormap (screen);
+visual = gdk_screen_get_rgba_visual (screen);
+if (visual == NULL)
+ visual = gdk_screen_get_system_visual (screen);
-gtk_widget_set_colormap (widget, colormap);
+gtk_widget_set_visual (GTK_WIDGET (window), visual);
</programlisting></informalexample>
-One possibility to fill the alpha channel on the window is to use
-gdk_draw_rgb_32_image().
+To fill the alpha channel on the window simply use cairos
+RGBA drawing capabilities.
</para>
<para>
Note that the presence of an RGBA visual is no guarantee that the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]