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

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

?? cha-gtk.html

?? GTK+_ Gnome Application Development
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
            </p>            <p>              Once you have a <span class="STRUCTNAME">              GtkWidget*</span> representing an object, you can              manipulate the object using its methods. All GTK+              widget functions begin with the name of the type they              operate on, and accept a pointer to that type as the              first argument. In the above code, <tt class=              "FUNCTION">gtk_container_add()</tt> accepts a <span              class="STRUCTNAME">GtkContainer*</span> as the first              argument. The macro <tt class="FUNCTION">              GTK_CONTAINER()</tt> casts the <span class=              "STRUCTNAME">GtkWidget*</span>, and also performs a              runtime type check. Casting is required because C              does not understand the inheritance relationship.            </p>            <p>              As you might imagine, <tt class="CLASSNAME">              GtkButton</tt> and <tt class="CLASSNAME">              GtkWindow</tt> are both subclasses of <tt class=               "CLASSNAME">GtkContainer</tt>. A <tt class=              "CLASSNAME">GtkContainer</tt> can hold any other              widget inside. The code creates a toplevel window,              places a button inside it, and places a label (line              of text) inside the button. Then it sets the window              title, and adds a small cosmetic border around the              button.            </p>          </div>          <div class="SECT3">            <h3 class="SECT3">              <a name="Z44">Signals</a>            </h3>            <p>              Next, you'll want to arrange to respond when users              manipulate the widgets. In this simple application,              there are two interesting things that can happen: the              user can click the button, or close the window using              a window manager decoration. Widgets (actually, all              <span class="STRUCTNAME">GtkObject</span>s) emit <i              class="FIRSTTERM">signals</i> when something              interesting happens a program might want to respond              to. To respond to a signal, you "connect a callback"              to it---i.e., register a function to be called when              the signal is emitted. Here's that code again:            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;  gtk_signal_connect(GTK_OBJECT(window),                     "delete_event",                     GTK_SIGNAL_FUNC(delete_event_cb),                     NULL);  gtk_signal_connect(GTK_OBJECT(button),                     "clicked",                     GTK_SIGNAL_FUNC(button_click_cb),                     label);&#13;</pre>                </td>              </tr>            </table>            <p>              <tt class="FUNCTION">gtk_signal_connect()</tt>              specifies the <span class="STRUCTNAME">              GtkObject</span> to monitor, which signal to connect              to, the callback to connect, and finally a <span              class="STRUCTNAME">user_data</span> argument---this              is an arbitrary <span class="STRUCTNAME">              gpointer</span> which will be passed to the callback.              The macro <tt class="FUNCTION">GTK_SIGNAL_FUNC()</tt>              casts the callback to a standard function signature;              since callbacks have a variety of type signatures,              the alternative would be dozens of <tt class=              "FUNCTION">gtk_signal_connect()</tt> variants.            </p>            <p>              GTK+ performs copious runtime sanity checking; the              <tt class="FUNCTION">GTK_OBJECT()</tt> macro includes              a runtime type check in addition to a C cast, and <tt              class="FUNCTION">gtk_signal_connect()</tt> will              verify that the object can actually emit the signal              you've specified.            </p>          </div>          <div class="SECT3">            <h3 class="SECT3">              <a name="Z45">Entering the Main Loop</a>            </h3>            <p>              Once everything is set up, two steps remain: you need              to show the window on the screen, and wait for user              input.            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;  gtk_widget_show_all(window);  gtk_main();  return 0;&#13;</pre>                </td>              </tr>            </table>            <p>              <tt class="FUNCTION">gtk_widget_show_all()</tt>              recursively calls <tt class="FUNCTION">              gtk_widget_show()</tt> on a container and its              children. The following code would have the same              effect in this case:            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;  gtk_widget_show(label);  gtk_widget_show(button);  gtk_widget_show(window);&#13;</pre>                </td>              </tr>            </table>            <p>              It's necessary to show each and every widget that you              want to appear on the screen. The opposite operation              is called <tt class="FUNCTION">              gtk_widget_hide()</tt>; widgets start their life              hidden, and can be re-hidden/re-shown any number of              times. It's good practice to show all child widgets              before showing the outermost container; otherwise,              the user will see the container appear first,              followed by its children. Widgets are not actually              visible on the screen until their parent container is              shown---the exception to the rule is <tt class=               "CLASSNAME">GtkWindow</tt>, since it has no parent.            </p>            <p>              Once your widgets have been shown, you want to wait              for the user to do something with them. <tt class=               "FUNCTION">gtk_main()</tt> enters the GTK+ main loop;              the main loop is event-driven. That is, user actions              trigger <i class="FIRSTTERM">events</i> which              generally result in signals being emitted and your              callbacks being called. <tt class="FUNCTION">              gtk_main()</tt> blocks indefinitely, waiting for and              responding to user input. The main loop is described              in more detail in <a href="sec-mainloop.html">the              section called <i>The Main Loop</i></a>. Events and              their relation to the main loop are described in <a              href="sec-gdkevent.html">the section called <i>              Events</i> in the chapter called <i>GDK              Basics</i></a>.            </p>          </div>          <div class="SECT3">            <h3 class="SECT3">              <a name="Z46">More on Signals and Callbacks</a>            </h3>            <p>              If either of the signals the program connects to is              emitted, the corresponding callback is called. Our              <span class="SYMBOL">"delete_event"</span> callback              ends the <tt class="FUNCTION">gtk_main()</tt> event              loop by calling <tt class="FUNCTION">              gtk_main_quit()</tt>; this causes <tt class=              "FUNCTION">gtk_main()</tt> to return, ending the              program. The <span class="SYMBOL">"clicked"</span>              callback replaces the text from the label with the              same text in reverse. Notice that the label was              passed to the callback as the <span class=              "STRUCTNAME">user_data</span> parameter to <tt class=               "FUNCTION">gtk_signal_connect()</tt>.            </p>            <p>              A common mistake is to assume that all signals use              the same kind of callback---not true. Each signal              requires a callback with a particular type signature              and particular behavior. The <span class="SYMBOL">              "clicked"</span> signal has a very common callback              type; its callback receives a pointer to the widget              emitting the signal and any <span class="STRUCTNAME">              user_data</span> provided by the programmer. This              callback <i class="EMPHASIS">must</i> return <span              class="STRUCTNAME">void</span> or memory corruption              is likely to occur.            </p>            <p>              <span class="SYMBOL">"delete_event"</span>, on the              other hand, is something of a special case. It              accepts three arguments; the first and last are              analagous to <span class="SYMBOL">"clicked"</span>,              while the second is a pointer to the event which              triggered the signal (<i class="FIRSTTERM">events</i>              are messages from X to the application, reporting              mouse movements, key presses, and the like). The              <span class="SYMBOL">"delete_event"</span> callback              returns a "magic" value---if <span class=              "STRUCTNAME">FALSE</span> is returned, GTK+ will              destroy the window; if <span class="STRUCTNAME">              TRUE</span> is returned, GTK+ will do nothing. Return              <span class="STRUCTNAME">TRUE</span> if you need to              do something other than destroy the window; for              example, you might want to warn the user about an              unsaved document.            </p>            <p>              Widget header files are the best quick reference for              callback signatures. The "class structure" for the              widget will have a space for a default signal              handler; your handler should be modeled on the              default one. For example, in <tt class="FILENAME">              gtk/gtkbutton.h</tt> the <tt class="CLASSNAME">              GtkButton</tt> class struct looks like this:            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;struct _GtkButtonClass{  GtkBinClass        parent_class;    void (* pressed)  (GtkButton *button);  void (* released) (GtkButton *button);  void (* clicked)  (GtkButton *button);  void (* enter)    (GtkButton *button);  void (* leave)    (GtkButton *button);};&#13;</pre>                </td>              </tr>            </table>            <p>              <a href="cha-objects.html">the chapter called <i>The              GTK+ Object and Type System</i></a> explains exactly              what a class struct is for; for now, just pay              attention to the function pointers, and note that              they correspond to signals. To get from this:            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;  void (* clicked)  (GtkButton *button);&#13;</pre>                </td>              </tr>            </table>            <p>              to this:            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;  static void button_click_cb(GtkWidget* w, gpointer data);&#13;</pre>                </td>              </tr>            </table>            <p>              simply add a <span class="STRUCTNAME">gpointer              data</span> to the class struct function's signature.              In Hello, World I've also changed the type from <span              class="STRUCTNAME">GtkButton*</span> to <span class=               "STRUCTNAME">GtkWidget*</span>; this is common, since              it can be more convenient to have a <span class=               "STRUCTNAME">GtkWidget*</span>. The argument will              always be the <tt class="CLASSNAME">GtkButton</tt>              emitting the signal.            </p>            <p>              Another example may be useful; here is <span class=               "SYMBOL">"delete_event"</span> from <tt class=               "FILENAME">gtk/gtkwidget.h</tt>:            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;  gint (* delete_event)            (GtkWidget          *widget,                                    GdkEventAny        *event);&#13;</pre>                </td>              </tr>            </table>            <p>              and the callback from Hello, World:            </p>            <table border="0" bgcolor="#E0E0E0" width="100%">              <tr>                <td><pre class="PROGRAMLISTING">&#13;static gint delete_event_cb(GtkWidget* w, GdkEventAny* e, gpointer data);&#13;</pre>                </td>              </tr>            </table>            <p>              That's all there is to it. You can write simple GTK+              applications using only the information presented in              this section. GTK+ and Gnome are powerful application              development tools because you can think about real              functionality, instead of struggling to get a window              on the screen.            </p>          </div>        </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="z35.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="sec-containers.html"><font color="#0000ff"            size="2"><b>Next &gt;&gt;&gt;</b></font></a>          </td>        </tr>        <tr>          <td colspan="2" align="left">            <font color="#000000" size="2"><b>Other            Features</b></font>          </td>          <td colspan="2" align="right">            <font color="#000000" size="2"><b>Containers And Widget            Layout</b></font>          </td>        </tr>      </table>    </div>  </body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品不卡一区| 欧美日韩高清在线| www.色综合.com| 欧美视频在线不卡| 亚洲国产日韩av| 午夜电影网一区| 成人永久看片免费视频天堂| 一区二区三区中文在线| 国产日产欧美一区二区视频| 亚洲天堂av一区| 久久精品噜噜噜成人88aⅴ| 亚洲人妖av一区二区| 秋霞电影一区二区| 欧美aaaaaa午夜精品| 成人av影视在线观看| 久久99精品国产麻豆不卡| 97aⅴ精品视频一二三区| 国产精品77777竹菊影视小说| 久久精品国产99| 一区二区三区在线视频观看58| 久色婷婷小香蕉久久| 91麻豆精品一区二区三区| 成人国产精品免费观看动漫| 色婷婷综合久久| 国产午夜精品一区二区三区四区| 亚洲国产一区视频| 93久久精品日日躁夜夜躁欧美| 69av一区二区三区| 亚洲色图制服诱惑 | www.亚洲在线| 国产成人在线色| 欧美日韩精品三区| 亚洲国产精品av| 国产乱人伦偷精品视频不卡| 国产精品一区二区果冻传媒| 欧美日韩成人综合在线一区二区| 亚洲视频一区二区免费在线观看| 亚洲精品免费看| 成人国产精品免费观看| 久久先锋影音av鲁色资源| 欧美日韩一二三区| 7777精品伊人久久久大香线蕉最新版| 中文字幕一区不卡| 国产精品色一区二区三区| 最新日韩av在线| 成人v精品蜜桃久久一区| 久久久久久久综合色一本| 亚洲成人激情综合网| 在线精品视频免费观看| 中文字幕视频一区二区三区久| 岛国精品在线观看| 欧美丰满嫩嫩电影| 久久精品一区二区三区不卡| 久久综合国产精品| 一区二区三区在线播| 91麻豆国产福利在线观看| 最新中文字幕一区二区三区| 一区二区三区四区精品在线视频| 蜜桃精品视频在线| 色偷偷久久人人79超碰人人澡| 91麻豆精品国产91久久久 | 久久精品国产亚洲a| 欧美一级高清片| 激情综合色播五月| 91精品国产丝袜白色高跟鞋| 国产欧美精品一区| 99精品一区二区| 精品国产青草久久久久福利| 午夜免费久久看| 欧美tk丨vk视频| 国产v综合v亚洲欧| 亚洲男人的天堂在线aⅴ视频| 91丨九色丨尤物| 亚洲国产一区二区视频| 精品三级在线看| 亚洲精品乱码久久久久| 国产精华液一区二区三区| 久久精品日产第一区二区三区高清版 | 欧美日韩一区二区三区免费看| 91精品免费在线| 国产在线精品免费av| 欧美私模裸体表演在线观看| 亚洲国产精品一区二区www在线| 国产精品一区二区在线看| 7777精品久久久大香线蕉| 欧美精三区欧美精三区| 一区二区三区视频在线观看| 久久亚洲精品小早川怜子| 国产精品18久久久久| 首页国产丝袜综合| 亚洲视频在线一区观看| 国产日产欧美一区二区视频| 成人性生交大片免费| 中文字幕 久热精品 视频在线 | 国产精品123区| 亚洲日本一区二区| 欧美亚洲国产一卡| 爽好多水快深点欧美视频| 亚洲人成网站色在线观看| 欧美色精品天天在线观看视频| 不卡一区中文字幕| 福利一区二区在线观看| 六月丁香婷婷久久| 国产精品免费av| 在线中文字幕一区二区| 91年精品国产| 91麻豆福利精品推荐| av一二三不卡影片| 91亚洲男人天堂| 99精品视频中文字幕| 97精品电影院| 91麻豆精东视频| 色域天天综合网| 久久疯狂做爰流白浆xx| 日本va欧美va精品| 国产精品久久久久一区二区三区共| 欧美午夜精品久久久久久孕妇 | 日韩亚洲欧美中文三级| 福利一区在线观看| 不卡欧美aaaaa| 一本到高清视频免费精品| 色琪琪一区二区三区亚洲区| 在线免费观看视频一区| 久草这里只有精品视频| 国产一区二区在线免费观看| 精品欧美一区二区在线观看| 91蜜桃网址入口| 91福利国产精品| 国产精品白丝av| 亚洲午夜精品在线| 欧美不卡视频一区| 欧美激情在线一区二区| 欧美一区二区啪啪| 91毛片在线观看| 欧美肥大bbwbbw高潮| 一本久久综合亚洲鲁鲁五月天 | 一本到一区二区三区| 欧美日韩国产天堂| 国产.欧美.日韩| 欧美性受xxxx| 日本高清视频一区二区| 国产成人精品亚洲午夜麻豆| 91在线小视频| 粉嫩在线一区二区三区视频| 99精品一区二区| 欧美一区二区黄色| 国产精品丝袜91| 午夜a成v人精品| 国产成人精品免费在线| 久久99久久99小草精品免视看| 国产91色综合久久免费分享| 色综合天天综合网天天看片| 免费成人美女在线观看.| 高清国产一区二区| 欧美日韩视频专区在线播放| 久久久夜色精品亚洲| 久久久久一区二区三区四区| 日韩午夜激情视频| 成人免费一区二区三区在线观看| 午夜精品久久久久久久99水蜜桃| 伊人夜夜躁av伊人久久| 亚洲免费av高清| 国产一区二区剧情av在线| 日本成人在线电影网| 99麻豆久久久国产精品免费| 成人黄色777网| 91亚洲国产成人精品一区二三| 精品国产一区二区国模嫣然| 自拍偷拍亚洲激情| 国产成人精品影视| 日韩网站在线看片你懂的| 欧美日韩在线直播| 综合激情成人伊人| 国产乱妇无码大片在线观看| 福利一区在线观看| 精品国产一区二区三区久久影院| 亚洲欧美日韩一区| 亚洲国产精品天堂| 久久成人久久鬼色| 欧美欧美午夜aⅴ在线观看| 国产精品美女久久久久久2018| 国产精品久久久久毛片软件| 亚洲免费在线播放| 亚洲成人免费电影| 久久99国产精品久久99果冻传媒| 国产精品自在欧美一区| 日韩三级视频在线观看| 久久婷婷色综合| 久久99精品国产| 色综合久久久久| 国产精品乱码人人做人人爱| 亚洲一区二区三区在线| 色综合久久中文综合久久牛| 色综合久久久久久久| 欧美日韩久久久| 亚洲成a人片在线不卡一二三区 | 久久婷婷久久一区二区三区| 精品在线视频一区| 成人午夜视频在线观看| 国产欧美综合色|