📄 gdk-windows.html
字号:
</tr><tr><td><p><span class="term"><a name="GDK-WINDOW-DIALOG:CAPS"></a><code class="literal">GDK_WINDOW_DIALOG</code></span></p></td><td>useless/deprecated compatibility type</td></tr><tr><td><p><span class="term"><a name="GDK-WINDOW-TEMP:CAPS"></a><code class="literal">GDK_WINDOW_TEMP</code></span></p></td><td>override redirect temporary window (used to implement <ahref="/usr/share/gtk-doc/html/gtk/GtkMenu.html"><span class="type">GtkMenu</span></a>)</td></tr><tr><td><p><span class="term"><a name="GDK-WINDOW-FOREIGN:CAPS"></a><code class="literal">GDK_WINDOW_FOREIGN</code></span></p></td><td>foreign window (see <a class="link" href="gdk-X-Window-System-Interaction.html#gdk-window-foreign-new"><code class="function">gdk_window_foreign_new()</code></a>)</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3183993"></a><h3><a name="GdkWindowClass"></a>enum GdkWindowClass</h3><a class="indexterm" name="id3184006"></a><pre class="programlisting">typedef enum{ GDK_INPUT_OUTPUT, GDK_INPUT_ONLY} GdkWindowClass;</pre><p><em class="parameter"><code>GDK_INPUT_OUTPUT</code></em> windows are the standard kind of window you might expect. <em class="parameter"><code>GDK_INPUT_ONLY</code></em> windows are invisible; they are used to trap events, but you can't draw on them.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GDK-INPUT-OUTPUT:CAPS"></a><code class="literal">GDK_INPUT_OUTPUT</code></span></p></td><td>window for graphics and events</td></tr><tr><td><p><span class="term"><a name="GDK-INPUT-ONLY:CAPS"></a><code class="literal">GDK_INPUT_ONLY</code></span></p></td><td>window for events only</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3184086"></a><h3><a name="GdkWindowHints"></a>enum GdkWindowHints</h3><a class="indexterm" name="id3184099"></a><pre class="programlisting">typedef enum{ GDK_HINT_POS = 1 << 0, GDK_HINT_MIN_SIZE = 1 << 1, GDK_HINT_MAX_SIZE = 1 << 2, GDK_HINT_BASE_SIZE = 1 << 3, GDK_HINT_ASPECT = 1 << 4, GDK_HINT_RESIZE_INC = 1 << 5, GDK_HINT_WIN_GRAVITY = 1 << 6, GDK_HINT_USER_POS = 1 << 7, GDK_HINT_USER_SIZE = 1 << 8} GdkWindowHints;</pre><p>Used to indicate which fields of a <a class="link" href="gdk-Windows.html#GdkGeometry"><span class="type">GdkGeometry</span></a> struct should be paid attentionto. Also, the presence/absence of <em class="parameter"><code>GDK_HINT_POS</code></em>, <em class="parameter"><code>GDK_HINT_USER_POS</code></em>, and<em class="parameter"><code>GDK_HINT_USER_SIZE</code></em> is significant, though they don't directly refer to<a class="link" href="gdk-Windows.html#GdkGeometry"><span class="type">GdkGeometry</span></a> fields. <em class="parameter"><code>GDK_HINT_USER_POS</code></em> will be set automatically by <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html"><span class="type">GtkWindow</span></a>if you call <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html#gtk-window-move"><code class="function">gtk_window_move()</code></a>. <em class="parameter"><code>GDK_HINT_USER_POS</code></em> and <em class="parameter"><code>GDK_HINT_USER_SIZE</code></em> should be set if the user specified a size/position using a --geometry command-line argument; <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html#gtk-window-parse-geometry"><code class="function">gtk_window_parse_geometry()</code></a> automatically sets theseflags.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><a name="GDK-HINT-POS:CAPS"></a><code class="literal">GDK_HINT_POS</code></span></p></td><td>indicates that the program has positioned the window</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-MIN-SIZE:CAPS"></a><code class="literal">GDK_HINT_MIN_SIZE</code></span></p></td><td>min size fields are set</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-MAX-SIZE:CAPS"></a><code class="literal">GDK_HINT_MAX_SIZE</code></span></p></td><td>max size fields are set</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-BASE-SIZE:CAPS"></a><code class="literal">GDK_HINT_BASE_SIZE</code></span></p></td><td>base size fields are set</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-ASPECT:CAPS"></a><code class="literal">GDK_HINT_ASPECT</code></span></p></td><td>aspect ratio fields are set</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-RESIZE-INC:CAPS"></a><code class="literal">GDK_HINT_RESIZE_INC</code></span></p></td><td>resize increment fields are set</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-WIN-GRAVITY:CAPS"></a><code class="literal">GDK_HINT_WIN_GRAVITY</code></span></p></td><td>window gravity field is set</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-USER-POS:CAPS"></a><code class="literal">GDK_HINT_USER_POS</code></span></p></td><td>indicates that the window's position was explicitly set by the user</td></tr><tr><td><p><span class="term"><a name="GDK-HINT-USER-SIZE:CAPS"></a><code class="literal">GDK_HINT_USER_SIZE</code></span></p></td><td>indicates that the window's size was explicitly set by the user</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3184424"></a><h3><a name="GdkGeometry"></a>GdkGeometry</h3><a class="indexterm" name="id3184436"></a><pre class="programlisting">typedef struct { gint min_width; gint min_height; gint max_width; gint max_height; gint base_width; gint base_height; gint width_inc; gint height_inc; gdouble min_aspect; gdouble max_aspect; GdkGravity win_gravity;} GdkGeometry;</pre><p>The <a class="link" href="gdk-Windows.html#GdkGeometry"><span class="type">GdkGeometry</span></a> struct gives the window manager information about a window's geometry constraints. Normally you would set these on the GTK+ level using <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html#gtk-window-set-geometry-hints"><code class="function">gtk_window_set_geometry_hints()</code></a>. <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html"><span class="type">GtkWindow</span></a> then sets the hints on the <a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> it creates.</p><p><a class="link" href="gdk-Windows.html#gdk-window-set-geometry-hints"><code class="function">gdk_window_set_geometry_hints()</code></a> expects the hints to be fully valid already andsimply passes them to the window manager; in contrast,<ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html#gtk-window-set-geometry-hints"><code class="function">gtk_window_set_geometry_hints()</code></a> performs some interpretation. For example,<ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html"><span class="type">GtkWindow</span></a> will apply the hints to the geometry widget instead of the toplevelwindow, if you set a geometry widget. Also, the<em class="parameter"><code>min_width</code></em>/<em class="parameter"><code>min_height</code></em>/<em class="parameter"><code>max_width</code></em>/<em class="parameter"><code>max_height</code></em> fields may be set to -1, and<ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html"><span class="type">GtkWindow</span></a> will substitute the size request of the window or geometry widget. Ifthe minimum size hint is not provided, <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html"><span class="type">GtkWindow</span></a> will use its requisition asthe minimum size. If the minimum size is provided and a geometry widget is set,<ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html"><span class="type">GtkWindow</span></a> will take the minimum size as the minimum size of the geometry widgetrather than the entire window. The base size is treated similarly.</p><p>The canonical use-case for <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html#gtk-window-set-geometry-hints"><code class="function">gtk_window_set_geometry_hints()</code></a> is to get a terminalwidget to resize properly. Here, the terminal text area should be the geometrywidget; <ahref="/usr/share/gtk-doc/html/gtk/GtkWindow.html"><span class="type">GtkWindow</span></a> will then automatically set the
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -