亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hc-objectargs.html

?? gtk_text program sample&eg
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>  <head>    <title>      Object Arguments    </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 GTK+ Object and Type System" href=     "cha-objects.html">    <link rel="PREVIOUS" title="GtkArg and the Type System" href=     "sec-gtkarg.html">    <link rel="NEXT" title="Signals" href="z109.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-gtkarg.html"><font color="#0000ff" size=            "2"><b>&lt;&lt;&lt; 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="z109.html"><font color="#0000ff" size="2"><b>            Next &gt;&gt;&gt;</b></font></a>          </td>        </tr>      </table>    </div>    <div class="SECT1">      <h1 class="SECT1">        <a name="HC-OBJECTARGS">Object Arguments</a>      </h1>      <p>        <i class="FIRSTTERM">Arguments</i> are one of the most        interesting features of <span class="STRUCTNAME">        GtkObject</span>. Arguments are a mechanism for handling        what CORBA's Interface Definition Language (IDL) calls an        <i class="FIRSTTERM">attribute</i>: a value with a "getter"        and a "setter." In concrete terms, object arguments pair a        key (which is a string) with a value (represented as a        <span class="STRUCTNAME">GtkArg</span>). Each <span class=         "STRUCTNAME">GtkObject</span> subclass can register        permissible keys and the <span class="STRUCTNAME">        GtkType</span>s of their associated values.      </p>      <p>        Using object arguments, one can discover at runtime what        attributes an object has, and then get or set their values.        This is very useful for people implementing GUI builders,        since some of the widget configuration dialogs can be        automated. Similarly, it makes it much easier to write GTK+        bindings for scripting languages. It can also be convenient        for programmers, since they can avoid writing all the        get/set functions---the <tt class="CLASSNAME">        GnomeCanvas</tt>, for example, uses object arguments for        almost all of its API. Finally, object arguments may be        configurable via the <tt class="FILENAME">gtkrc</tt>        configuration mechanism in a future version of GTK+, making        it possible for users to extensively customize GTK+        software.      </p>      <div class="SECT2">        <h2 class="SECT2">          <a name="Z106">Setting Object Arguments</a>        </h2>        <p>          Most commonly, arguments are used as an API to set          attributes of widgets. However, not all of the GTK+ API          has been exported via arguments, so it is not always          possible.        </p>        <p>          To set widget attributes, the most convenient interface          is <tt class="FUNCTION">gtk_object_set()</tt>. Here's an          example:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;   gtk_object_set(GTK_OBJECT(vbox),                   "GtkContainer::border_width", (gulong) 10,                  NULL);&#13;</pre>            </td>          </tr>        </table>        <p>          The above code is identical in effect to:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;   gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);&#13;</pre>            </td>          </tr>        </table>        <p>          It's up to you which to use; it depends on the context.          Typically, you would use the argument mechanism if you          have a reason to, i.e. if you are using its dynamic,          runtime-oriented features. However, if you are setting          several attributes, it may be easier to type and read.        </p>        <p>          <tt class="FUNCTION">gtk_object_set()</tt> takes a <span          class="STRUCTNAME">GtkObject</span> as the first          argument, followed by any number of key-value pairs. If a          key is not defined for the object you pass in, a runtime          error will be triggered. The list of key-value pairs must          be terminated with a <span class="STRUCTNAME">NULL</span>          key. When a <span class="STRUCTNAME">GtkObject</span>          registers itself with GTK+, it tells GTK+ what type of          value to expect after each key. For the aggregate          fundamental types <tt class="FUNCTION">          gtk_object_set()</tt> will expect more than one C          function argument after the key. For example, first a          signal function and then a user data pointer will be          expected after <span class="STRUCTNAME">          GTK_TYPE_SIGNAL</span> arguments. (<a href=           "sec-gtkarg.html#TABLE-FUNDTYPES">Table 1 in the section          called <i><span class="STRUCTNAME">GtkArg</span> and the          Type System</i></a> gives the types of the expected          arguments.)        </p>        <p>          It is permissible to leave off the object class portion          of an argument name---<span class=          "STRUCTNAME">"GtkContainer::border_width"</span> can be          simply <span class="STRUCTNAME">"border_width"</span>:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;   gtk_object_set(GTK_OBJECT(vbox),                   "border_width", (gulong) 10,                  NULL);&#13;</pre>            </td>          </tr>        </table>        <p>          If you do not specify the class name as part of the          argument name, GTK+ will start with the real type of the          object and look up the argument name in the argument          table for each superclass until it finds the right one          (<tt class="CLASSNAME">GtkContainer</tt> in this case).          If you do specify the class name, GTK+ will only look for          the argument in the specified class's argument table.        </p>        <p>          Since <tt class="FUNCTION">gtk_object_set()</tt> uses C          variable argument lists, it has limited type safety. This          can be a real problem in your code. You may have noticed          the cast to <span class="STRUCTNAME">gulong</span> in the          sample call to <tt class="FUNCTION">          gtk_object_set()</tt>. The argument <span class=           "STRUCTNAME">GtkContainer::border_width</span> has type          <span class="STRUCTNAME">GTK_TYPE_ULONG</span>. GTK+ will          extract <span class="STRUCTNAME">sizeof(gulong)</span>          bytes from the argument list when it encounters this          argument. If you leave out the cast, C will probably pass          only <span class="STRUCTNAME">sizeof(gint)</span> bytes          to the function. As you might imagine, this causes memory          corruption on many platforms. A similar problem arises          with arguments of type <span class="STRUCTNAME">          GTK_TYPE_DOUBLE</span>; if you type <span class=           "STRUCTNAME">5</span> instead of <span class=          "STRUCTNAME">5.0</span>, C will pass an integer to <tt          class="FUNCTION">gtk_object_set()</tt>. These bugs are          very hard to find, once you introduce them.        </p>        <p>          <tt class="FUNCTION">gtk_object_set()</tt> is syntactic          sugar for a more fundamental function call, <tt class=           "FUNCTION">gtk_object_setv()</tt>. <tt class="FUNCTION">          gtk_object_setv()</tt> takes a vector of <span class=           "STRUCTNAME">GtkArg</span> (<tt class=          "FUNCTION">gtk_object_set()</tt> converts each key-value          pair in its argument list to <span class="STRUCTNAME">          GtkArg</span> internally).        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;   GtkArg args[1];   args[0].name = "GtkContainer::border_width";   args[0].type = GTK_TYPE_ULONG;   GTK_VALUE_ULONG(args[0]) = 10;   gtk_object_setv(GTK_OBJECT(button),                    1,                   args);&#13;</pre>            </td>          </tr>        </table>        <p>          The second argument to <tt class="FUNCTION">          gtk_object_setv()</tt> is the length of the array of          <span class="STRUCTNAME">GtkArg</span>. <tt class=           "FUNCTION">gtk_object_set()</tt> is plainly easier to use          when you are typing the code in manually, but <tt class=           "FUNCTION">gtk_object_setv()</tt> can be passed a          dynamically-constructed argument array---which is          convenient if you're exporting GTK+ functionality to an          interpreted environment.        </p>        <p>          It is also possible to set object arguments when objects          are created. You can create most objects using the <tt          class="FUNCTION">gtk_object_new()</tt> function, and most          widgets with the <tt class="FUNCTION">          gtk_widget_new()</tt> function. The routines take a <span          class="STRUCTNAME">GtkType</span> as their first          argument, and create an object or widget of that type.          They then take a list of argument-value pairs, just as          <tt class="FUNCTION">gtk_object_set()</tt> does. There          are also <tt class="FUNCTION">gtk_object_newv()</tt> and          <tt class="FUNCTION">gtk_widget_newv()</tt> variants.        </p>      </div>      <div class="SECT2">        <h2 class="SECT2">          <a name="Z107">Reading Object Arguments</a>        </h2>        <p>          To get the value of one or more arguments, you simply          create an array of <span class="STRUCTNAME">          GtkArg</span>, filling in the <span class="STRUCTNAME">          name</span> field of each <span class="STRUCTNAME">          GtkArg</span>. <tt class="FUNCTION">          gtk_object_getv()</tt> fills in the <span class=           "STRUCTNAME">type</span> fields and the argument values.          If an error occurs, the <span class="STRUCTNAME">          type</span> field is set to <span class="STRUCTNAME">          GTK_TYPE_INVALID</span>. If the fundamental type of the          returned value is <span class="STRUCTNAME">          GTK_TYPE_STRING</span>, <span class="STRUCTNAME">          GTK_TYPE_BOXED</span>, or <span class="STRUCTNAME">          GTK_TYPE_ARGS</span>, you are responsible for freeing it.        </p>        <p>          Here's a simple example:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;  GtkArg args[2];      args[0].name = "GtkContainer::border_width";  args[1].name = "GtkContainer::resize_mode";  gtk_object_getv(GTK_OBJECT(button),                   2,                   args);  g_assert(args[0].type == GTK_TYPE_ULONG);  g_assert(args[1].type == GTK_TYPE_RESIZE_MODE);  g_assert(GTK_FUNDAMENTAL_TYPE(args[1].type) == GTK_TYPE_ENUM);  printf("Border width: %lu Resize mode: %d\n",          GTK_VALUE_ULONG(args[0]), GTK_VALUE_ENUM(args[1]));&#13;</pre>            </td>          </tr>        </table>      </div>      <div class="SECT2">        <h2 class="SECT2">          <a name="SEC-GETSETARG">Using Object Arguments in Your          Own <span class="STRUCTNAME">GtkObject</span>          Subclass</a>        </h2>        <p>          If you're writing a custom <span class="STRUCTNAME">          GtkObject</span> or a custom subclass of some existing          object, you can register your own object arguments in the          class initialization function, at the same time you          register your object's signals. To do this, call <tt          class="FUNCTION">gtk_object_add_arg_type()</tt>---here's          an example from <tt class="CLASSNAME">GtkContainer</tt>:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;    gtk_object_add_arg_type("GtkContainer::border_width",                             GTK_TYPE_ULONG,                             GTK_ARG_READWRITE,                             ARG_BORDER_WIDTH);  </pre>            </td>          </tr>        </table>        <p>          The first argument must be a static string constant,          because GTK+ does not copy it. It must also begin with          the name of your new class, separated from the name of          the argument by two colons (reminiscent of the C++ scope          operator). The second argument should be the type of the          argument; this can be any <span class="STRUCTNAME">          GtkType</span> GTK+ knows about.        </p>        <p>          The third argument contains one or more flags, defined in          <tt class="FILENAME">gtk/gtkobject.h</tt>. The available          flags are:        </p>        <ul>          <li>            <p>              <span class="STRUCTNAME">GTK_ARG_READABLE</span>              means the argument's value can be read, using <tt              class="FUNCTION">gtk_object_getv()</tt>.&#13;            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ARG_WRITABLE</span>              means the argument's value can be written, using <tt              class="FUNCTION">gtk_object_set()</tt> or <tt class=               "FUNCTION">gtk_object_setv()</tt>&#13;            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ARG_CONSTRUCT</span>              means the argument should be initialized with a              default value. This applies to numeric and pointer              types; they are set to <span class="STRUCTNAME">              0</span> or <span class="STRUCTNAME">NULL</span>,              respectively. (This happens within <tt class=              "FUNCTION">gtk_object_new()</tt> or <tt class=               "FUNCTION">gtk_widget_new()</tt>, which call <tt              class="FUNCTION">              gtk_object_default_construct()</tt>.) &#13;            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">              GTK_ARG_CONSTRUCT_ONLY</span> means the argument is              <i class="EMPHASIS">only</i> used for object              construction; it cannot be read or written later.              That is, you can't use these arguments with <tt              class="FUNCTION">gtk_object_set()</tt>. &#13;            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ARG_CHILD_ARG</span> is              used by subclasses of <tt class="CLASSNAME">              GtkContainer</tt>; <tt class="CLASSNAME">              GtkContainer</tt> implements a specialized variation              on the argument system to permit setting the              attributes of child-container pairs (such as packing              flags for <tt class="CLASSNAME">GtkBox</tt>---the              flags are not a property of the child or the              container, but of the pair). You will only use this              flag if you're writing a new type of container, or              some other kind of object with similar semantics.              &#13;            </p>          </li>          <li>            <p>              <span class="STRUCTNAME">GTK_ARG_READWRITE</span> is

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久毛片| 91免费版pro下载短视频| 国产精品国产三级国产普通话三级| 99精品视频在线播放观看| www.亚洲精品| 99久精品国产| 欧日韩精品视频| 日本伦理一区二区| 欧美午夜精品一区二区三区| 色久优优欧美色久优优| 欧美影院午夜播放| 欧美日本在线观看| 欧美一区二区三区四区视频| 欧美一级久久久| 久久先锋影音av鲁色资源| 久久综合av免费| 国产精品视频一二三区 | 日韩成人dvd| 91在线免费看| 中文字幕在线观看不卡视频| 国产伦精品一区二区三区免费迷| 欧美三级电影网| 亚洲精品国产a久久久久久| 国产精品一区二区黑丝| 欧美本精品男人aⅴ天堂| 天堂va蜜桃一区二区三区漫画版| 色婷婷激情综合| 国产精品久99| 成人福利视频在线| 国产日韩精品视频一区| 国产在线视频一区二区三区| 欧美电影免费观看高清完整版| 视频在线观看一区二区三区| 欧美日韩国产一级二级| 在线视频国产一区| 欧美性猛交xxxxxxxx| 日韩免费高清av| 国产精品进线69影院| 日产国产欧美视频一区精品| 成人高清伦理免费影院在线观看| 欧美亚洲自拍偷拍| 欧美国产日韩a欧美在线观看| 亚洲愉拍自拍另类高清精品| 国产一区二区三区美女| 91免费观看在线| 久久午夜老司机| 日韩综合小视频| 色综合久久中文综合久久97| 精品国产乱码久久| 亚洲电影在线免费观看| 成人国产精品免费观看视频| 欧美成人艳星乳罩| 亚洲成人激情av| 99麻豆久久久国产精品免费优播| 欧美片在线播放| 伊人夜夜躁av伊人久久| 国产福利电影一区二区三区| 日韩欧美一级二级| 性久久久久久久| 在线亚洲一区二区| 亚洲欧洲一区二区在线播放| 国产一区二区精品在线观看| 欧美一二三区在线观看| 亚洲午夜视频在线观看| 91精彩视频在线| 综合久久国产九一剧情麻豆| 成人午夜av在线| 久久久精品人体av艺术| 激情亚洲综合在线| 精品va天堂亚洲国产| 裸体健美xxxx欧美裸体表演| 3atv一区二区三区| 性做久久久久久免费观看欧美| 色诱视频网站一区| 亚洲精品日日夜夜| 色婷婷综合久久久| 亚洲女同一区二区| 91久久精品日日躁夜夜躁欧美| 亚洲人成在线播放网站岛国| 天堂av在线一区| 欧美一区二区三区思思人| www.亚洲国产| 久久aⅴ国产欧美74aaa| 一二三四社区欧美黄| 久久蜜桃一区二区| 在线播放日韩导航| 在线播放日韩导航| 不卡一卡二卡三乱码免费网站| 日韩激情一二三区| 一区二区三区四区不卡在线| 久久人人97超碰com| 91精品国产美女浴室洗澡无遮挡| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 午夜伊人狠狠久久| 国产精品久久久久永久免费观看| 91精品国产91热久久久做人人| 亚洲一区影音先锋| 一本一道波多野结衣一区二区| 亚洲国产日日夜夜| 日韩欧美123| 国模一区二区三区白浆| 亚洲卡通欧美制服中文| 国产一区二区h| 中文字幕一区二区日韩精品绯色| 免费观看久久久4p| 日韩欧美色电影| 国产老女人精品毛片久久| 国产精品美女一区二区| 欧美日韩综合在线| 国产一区二区主播在线| 亚洲欧洲av在线| 制服视频三区第一页精品| 日韩av中文在线观看| 国产日韩欧美不卡在线| 欧美日韩视频不卡| 福利电影一区二区三区| 亚洲国产成人精品视频| 国产亚洲欧洲一区高清在线观看| av亚洲精华国产精华精华| 日本怡春院一区二区| 亚洲国产精品高清| 欧美电影在线免费观看| youjizz久久| 免费在线观看一区| 亚洲摸摸操操av| 久久精品人人做| 欧美一级二级三级蜜桃| 色综合网色综合| 国产99久久久国产精品潘金| 日本欧美肥老太交大片| 亚洲在线观看免费| 国产精品福利影院| 久久久久久久久久电影| 日韩丝袜美女视频| 欧美日韩一二三区| 91精品视频网| 91丝袜呻吟高潮美腿白嫩在线观看| 日本不卡视频在线观看| 一区二区三区日本| 国产精品情趣视频| 久久久久久久综合日本| 日韩欧美久久久| 欧美精品成人一区二区三区四区| 91视频你懂的| 91浏览器打开| 成人国产一区二区三区精品| 国产aⅴ精品一区二区三区色成熟| 久久99国产精品尤物| 久久人人97超碰com| 国产一区欧美日韩| 欧美狂野另类xxxxoooo| 欧美嫩在线观看| 久久久综合精品| 亚洲精品视频免费看| 精品一区二区影视| 99国内精品久久| 欧美日本在线观看| 国产片一区二区| 亚洲午夜私人影院| 成人精品小蝌蚪| 欧美精品九九99久久| 国产精品美女久久久久aⅴ国产馆| 亚洲成在人线在线播放| 国产成人av一区| 欧美日韩在线直播| 中文乱码免费一区二区| 日韩av电影免费观看高清完整版| 成人伦理片在线| 日韩欧美电影一区| 亚洲第一av色| 不卡的av中国片| 欧美成人一级视频| 五月激情综合色| 成人av动漫网站| 久久久亚洲午夜电影| 蜜臀久久99精品久久久画质超高清| 成人网在线播放| wwwwxxxxx欧美| 日韩激情视频在线观看| 欧洲一区二区三区在线| 国产精品久久影院| 国产69精品久久99不卡| 日韩情涩欧美日韩视频| 婷婷成人综合网| 欧美性猛交xxxx黑人交| 六月丁香婷婷久久| 日韩免费电影一区| 日本视频一区二区三区| 欧美老肥妇做.爰bbww视频| 亚洲影院免费观看| 91欧美一区二区| 亚洲视频免费看| 97aⅴ精品视频一二三区| 国产欧美日韩在线视频| 国产电影一区二区三区| 2欧美一区二区三区在线观看视频| 亚洲福利电影网| 欧美日本免费一区二区三区| 亚洲一区二区三区激情| 在线观看欧美日本|