?? z94.html
字號:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html> <head> <title> Finishing Touches </title> <meta name="GENERATOR" content= "Modular DocBook HTML Stylesheet Version 1.45"> <link rel="HOME" title="GTK+ / Gnome Application Development" href="ggad.html"> <link rel="UP" title="The Main Window: GnomeApp" href= "cha-main.html"> <link rel="PREVIOUS" title="Online Help" href="sec-help.html"> <link rel="NEXT" title="User Communication: Dialogs" href= "cha-dialogs.html"> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink= "#840084" alink="#0000FF"> <div class="NAVHEADER"> <table width="100%" border="0" bgcolor="#ffffff" cellpadding= "1" cellspacing="0"> <tr> <th colspan="4" align="center"> <font color="#000000" size="2">GTK+ / Gnome Application Development</font> </th> </tr> <tr> <td width="25%" bgcolor="#ffffff" align="left"> <a href="sec-help.html"><font color="#0000ff" size="2"> <b><<< Previous</b></font></a> </td> <td width="25%" colspan="2" bgcolor="#ffffff" align= "center"> <font color="#0000ff" size="2"><b><a href="ggad.html"> <font color="#0000ff" size="2"><b> Home</b></font></a></b></font> </td> <td width="25%" bgcolor="#ffffff" align="right"> <a href="cha-dialogs.html"><font color="#0000ff" size= "2"><b>Next >>></b></font></a> </td> </tr> </table> </div> <div class="SECT1"> <h1 class="SECT1"> <a name="Z94">Finishing Touches</a> </h1> <p> Really polished application windows behave well on small screens, and set hints so the window manager can keep track of them. </p> <div class="SECT2"> <h2 class="SECT2"> <a name="Z95">Adapting to Screen Size</a> </h2> <p> The functions in <a href="z94.html#FL-SCREENSIZE">Figure 12</a> allow you to query the size of the screen in pixels. You can use this information to adjust the layout of your application window; for example, if you know your usual application window is too large for a 640 by 480 display, you could provide an alternative widget layout for small screens. Applications that automatically adapt to the screen size are very impressive. </p> <p> Of course, you should leave control in the hands of the user; users with large screens might want the small version of your application anyway, and you should always try to respond sensibly if the user resizes the window. Use the screen size to select the best default from among your application's possible configurations. </p> <div class="FIGURE"> <a name="FL-SCREENSIZE"></a> <div class="FUNCSYNOPSIS"> <a name="FL-SCREENSIZE.SYNOPSIS"></a> <table border="0" bgcolor="#E0E0E0" width="100%"> <tr> <td><pre class="FUNCSYNOPSISINFO">#include <gdk/gdk.h></pre> </td> </tr> </table> <p> <code><code class="FUNCDEF">gint <tt class= "FUNCTION">gdk_screen_width</tt></code>(void);</code> </p> <p> <code><code class="FUNCDEF">gint <tt class= "FUNCTION"> gdk_screen_height</tt></code>(void);</code> </p> </div> <p> <b>Figure 12. Querying Screen Size</b> </p> </div> </div> <div class="SECT2"> <h2 class="SECT2"> <a name="SEC-CLASSHINT">Setting Window Class Hints</a> </h2> <p> The "class hint" is a property of <tt class="CLASSNAME"> GtkWindow</tt> window managers can read to decide how to treat the window. Most window managers allow you to set icons and other properties based on the class hint. Two elements make up the hint. The <span class="STRUCTNAME"> wmclass_name</span> field should be unique for each kind of toplevel window in an application (such as the main window or a tools dialog). The <span class="STRUCTNAME"> wmclass_class</span> field is conventionally set to the name of the application, capitalized. For example: <span class="STRUCTNAME">xterm</span> windows set these properties to <span class="STRUCTNAME">xterm</span> (name) and <span class="STRUCTNAME">XTerm</span> (class). The GIMP toolbox sets its name to <span class= "STRUCTNAME">toolbox</span> and its class to <span class= "STRUCTNAME">Gimp</span>. The <tt class="FUNCTION"> gtk_window_set_wmclass()</tt> function sets these hints for <tt class="CLASSNAME">GtkWindow</tt>. </p> <div class="FIGURE"> <a name="FL-CLASSHINT"></a> <div class="FUNCSYNOPSIS"> <a name="FL-CLASSHINT.SYNOPSIS"></a> <table border="0" bgcolor="#E0E0E0" width="100%"> <tr> <td><pre class="FUNCSYNOPSISINFO">#include <gtk/gtkwindow.h></pre> </td> </tr> </table> <p> <code><code class="FUNCDEF">void <tt class= "FUNCTION"> gtk_window_set_wmclass</tt></code>(GtkWindow* <tt class="PARAMETER"><i>window</i></tt>, const gchar* <tt class="PARAMETER"><i>wmclass_name</i></tt>, const gchar* <tt class="PARAMETER"><i> wmclass_class</i></tt>);</code> </p> </div> <p> <b>Figure 13. Setting Class Hints</b> </p> </div> </div> </div> <div class="NAVFOOTER"> <br> <br> <table width="100%" border="0" bgcolor="#ffffff" cellpadding= "1" cellspacing="0"> <tr> <td width="25%" bgcolor="#ffffff" align="left"> <a href="sec-help.html"><font color="#0000ff" size="2"> <b><<< Previous</b></font></a> </td> <td width="25%" colspan="2" bgcolor="#ffffff" align= "center"> <font color="#0000ff" size="2"><b><a href="ggad.html"> <font color="#0000ff" size="2"><b> Home</b></font></a></b></font> </td> <td width="25%" bgcolor="#ffffff" align="right"> <a href="cha-dialogs.html"><font color="#0000ff" size= "2"><b>Next >>></b></font></a> </td> </tr> <tr> <td colspan="2" align="left"> <font color="#000000" size="2"><b>Online Help</b></font> </td> <td colspan="2" align="right"> <font color="#000000" size="2"><b>User Communication: Dialogs</b></font> </td> </tr> </table> </div> </body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -