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

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

?? z147.html

?? gtk_text program sample&eg
?? HTML
?? 第 1 頁 / 共 4 頁
字號:
        <p>          If you aren't familiar with the concept of <i class=           "FIRSTTERM">realizing</i> and <i class="FIRSTTERM">          mapping</i> a widget, go back and read <a href=           "z57.html#SEC-REALIZINGSHOWING">the section called <i>          Realizing, Mapping, and Showing</i> in the chapter called          <i>GTK+ Basics</i></a> before reading this section.        </p>        <p>          <tt class="CLASSNAME">GtkEv</tt> does not override the          map or unmap method; the default <tt class="CLASSNAME">          GtkWidget</tt> methods suffice. The defaults set and          unset the <span class="STRUCTNAME">          GTK_WIDGET_MAPPED</span> flag, and show or hide <span          class="STRUCTNAME">widget-&gt;window</span>.        </p>        <p>          Any widget with a <span class="STRUCTNAME">          GdkWindow</span> that has <tt class="CLASSNAME">          GtkWidget</tt> as its immediate parent will need to          override the realize method; the default is only suitable          for windowless widgets. <tt class="CLASSNAME">GtkEv</tt>          is no exception. <tt class="CLASSNAME">GtkEv</tt> also          overrides the unrealize method, in order to destroy the          event window.        </p>        <p>          Here is <tt class="CLASSNAME">GtkEv</tt>'s realize          method:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;static void gtk_ev_realize        (GtkWidget        *widget){  GdkWindowAttr attributes;  gint attributes_mask;  GtkEv* ev;  GdkCursor* cursor;  g_return_if_fail(widget != NULL);  g_return_if_fail(GTK_IS_EV(widget));  ev = GTK_EV(widget);  /* Set realized flag */  GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);  /* Main widget window */  attributes.window_type = GDK_WINDOW_CHILD;  attributes.x = widget-&gt;allocation.x;  attributes.y = widget-&gt;allocation.y;  attributes.width = widget-&gt;allocation.width;  attributes.height = widget-&gt;allocation.height;  attributes.wclass = GDK_INPUT_OUTPUT;  attributes.visual = gtk_widget_get_visual (widget);  attributes.colormap = gtk_widget_get_colormap (widget);  attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;  widget-&gt;window = gdk_window_new (gtk_widget_get_parent_window (widget),                                   &amp;attributes, attributes_mask);  gdk_window_set_user_data (widget-&gt;window, widget);  /* Event window */  cursor = gdk_cursor_new(GDK_CROSSHAIR);  attributes.window_type = GDK_WINDOW_CHILD;  attributes.x = ev-&gt;event_window_rect.x;  attributes.y = ev-&gt;event_window_rect.y;  attributes.width = ev-&gt;event_window_rect.width;  attributes.height = ev-&gt;event_window_rect.height;  attributes.wclass = GDK_INPUT_OUTPUT;  attributes.visual = gtk_widget_get_visual (widget);  attributes.colormap = gtk_widget_get_colormap (widget);  attributes.event_mask = GDK_ALL_EVENTS_MASK;  attributes.cursor = cursor;  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL |     GDK_WA_COLORMAP | GDK_WA_CURSOR;  ev-&gt;event_window = gdk_window_new (widget-&gt;window,                                     &amp;attributes, attributes_mask);  gdk_window_set_user_data (ev-&gt;event_window, widget);  gdk_window_show(ev-&gt;event_window);  gdk_cursor_destroy(cursor);  /* Style */  widget-&gt;style = gtk_style_attach (widget-&gt;style, widget-&gt;window);  gtk_style_set_background (widget-&gt;style, widget-&gt;window, GTK_STATE_NORMAL);  gdk_window_set_background (ev-&gt;event_window,                              &amp;widget-&gt;style-&gt;base[GTK_STATE_NORMAL]);}      </pre>            </td>          </tr>        </table>        <p>          The first step in any realize method is to set the <span          class="STRUCTNAME">GTK_REALIZED</span> flag; this is a          small but important detail. After that, most of the          realize method is concerned with creating the two <span          class="STRUCTNAME">GdkWindow</span>s, as described in <a          href="sec-gdkwindow.html">the section called <i><span          class="STRUCTNAME">GdkWindow</span></i> in the chapter          called <i>GDK Basics</i></a>. <span class="STRUCTNAME">          widget-&gt;window</span> should be created as a subwindow          of the widget's parent's <span class="STRUCTNAME">          GdkWindow</span>; the parent window is obtained with <tt          class="FUNCTION">gtk_widget_get_parent_window()</tt>.        </p>        <p>          Notice that <i class="EMPHASIS">all</i> events are          requested on the event window, for obvious reasons. Also,          the event window has a special cursor, to give the user          visual feedback when the pointer moves into it. The          client-side cursor handle is destroyed immediately after          attaching the cursor to the window; the X server will          keep it around as long as it's in use.        </p>        <p>          After creating each <span class="STRUCTNAME">          GdkWindow</span>, a pointer to the <tt class="CLASSNAME">          GtkEv</tt> is stored in the <span class="STRUCTNAME">          GdkWindow</span>'s "user data" field. GTK+ uses the          contents of this field to determine which widget should          receive events that occur on the window. Recall that GTK+          receives a stream of events from GDK, and that each <span          class="STRUCTNAME">GdkEvent</span> has a <span class=           "STRUCTNAME">window</span> field indicating the <span          class="STRUCTNAME">GdkWindow</span> that received it.          GTK+ forwards each event to the widget owning the event's          <span class="STRUCTNAME">GdkWindow</span>. (<a href=           "sec-gdkevent.html">the section called <i>Events</i> in          the chapter called <i>GDK Basics</i></a> details this          process if you don't remember.)        </p>        <p>          The code calls <tt class="FUNCTION">          gdk_window_show()</tt> on the event window but not <span          class="STRUCTNAME">widget-&gt;window</span>; <span class=           "STRUCTNAME">widget-&gt;window</span> should not be shown          until the widget is mapped. Because the event window is a          child of <span class="STRUCTNAME">          widget-&gt;window</span>, it will remain offscreen until          its parent is shown. Alternatively, <tt class=          "CLASSNAME">GtkEv</tt> could implement a map method to          show the child, but this way seems simpler.        </p>        <p>          All widgets must take create their associated <span          class="STRUCTNAME">GtkStyle</span> in their realize          method, because a style contains X resources. (See <a          href="sec-style.html">the section called <i><span class=           "STRUCTNAME">GtkStyle</span> and Themes</i> in the          chapter called <i>GDK Basics</i></a> for more information          about <span class="STRUCTNAME">GtkStyle</span>.) Recall          from <a href="z57.html#SEC-REALIZINGSHOWING">the section          called <i>Realizing, Mapping, and Showing</i> in the          chapter called <i>GTK+ Basics</i></a> that widgets          allocate all X resources in their realize method. GTK+          provides a simple function to create a widget's style:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;  widget-&gt;style = gtk_style_attach (widget-&gt;style, widget-&gt;window);      </pre>            </td>          </tr>        </table>        <p>          <i class="EMPHASIS">After</i> filling in <span class=           "STRUCTNAME">widget-&gt;style</span>, <tt class=          "CLASSNAME">GtkEv</tt> uses colors from the style to set          window backgrounds. It sets the main window's background          using <tt class="FUNCTION">          gtk_style_set_background()</tt>, which could do almost          anything (it might invoke a routine from a dynamically          loaded theme module). If the default theme is running, it          simply sets the window's background to an appropriate          color or pixmap tile. There is no special style function          to set the background of the event window, so we set it          to the "base" color (the base color is white by default;          it's the background color for lists and text entries).          Selecting a color from the style means that users will be          able to customize the widget's color. It's also          convenient to avoid allocating and deallocating a custom          color.        </p>        <p>          Notice that the realize method does not chain up to the          default realize method, because the default isn't          appropriate for <tt class="CLASSNAME">GtkEv</tt>.        </p>        <p>          Unrealizing <tt class="CLASSNAME">GtkEv</tt> is          relatively simple:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;static void gtk_ev_unrealize (GtkWidget        *widget){  GtkEv* ev;  g_return_if_fail(widget != NULL);  g_return_if_fail(GTK_IS_EV(widget));  ev = GTK_EV(widget);  /* Hide all windows */  if (GTK_WIDGET_MAPPED (widget))    gtk_widget_unmap (widget);    GTK_WIDGET_UNSET_FLAGS (widget, GTK_MAPPED);  /* Destroy our child window */  if (ev-&gt;event_window)    {      gdk_window_set_user_data(ev-&gt;event_window, NULL);      gdk_window_destroy(ev-&gt;event_window);      ev-&gt;event_window = NULL;    }  /* This destroys widget-&gt;window and unsets the realized flag   */  if (GTK_WIDGET_CLASS(parent_class)-&gt;unrealize)    (* GTK_WIDGET_CLASS(parent_class)-&gt;unrealize) (widget);}      </pre>            </td>          </tr>        </table>        <p>          First, the unrealize method ensures that the widget is          unmapped. This is essential: GTK+ maintains the invariant          that mapped widgets are also realized. Next, the          unrealize method destroys the event window. It sets the          window's user data to <span class="STRUCTNAME">          NULL</span> before destroying it; otherwise <tt class=           "CLASSNAME">GtkEv</tt> would receive a useless destroy          event. Finally, <tt class="CLASSNAME">GtkEv</tt> chains          up to the default unrealize method, which unsets the          <span class="STRUCTNAME">GTK_WIDGET_REALIZED</span> flag          and destroys <span class="STRUCTNAME">          widget-&gt;window</span>. Unrealize implemenations are <i          class="EMPHASIS">required</i> to chain up to their base          class's implementation.        </p>        <p>          When writing your realize and unrealize methods, keep in          mind that they can be called multiple times, but they are          always paired. That is, a widget can be unrealized and          re-realized over and over, but it will never be realized          twice without an intervening unrealize. The pairing is          guaranteed; that is, if a widget is realized it will          definitely be unrealized sooner or later, unless the          program exits.        </p>      </div>      <div class="SECT2">        <h2 class="SECT2">          <a name="SEC-GTKEVSIZENEG">Size Negotiation</a>        </h2>        <p>          <a href="sec-containers.html#SEC-SIZENEGOTIATION">the          section called <i>Size Allocation</i> in the chapter          called <i>GTK+ Basics</i></a> describes the size          negotiation process; be sure you're familiar with it          before reading this section.        </p>        <p>          There's no obvious "right" size for <span class=           "STRUCTNAME">GtkEv</span>, so the size request method          requests an arbitrary size that looks nice:        </p>        <table border="0" bgcolor="#E0E0E0" width="100%">          <tr>            <td><pre class="PROGRAMLISTING">&#13;static void gtk_ev_size_request   (GtkWidget        *widget,                       GtkRequisition   *requisition){  g_return_if_fail(widget != NULL);  g_return_if_fail(GTK_IS_EV(widget));  /*    * GtkEv always wants to be the same fixed size.   */    requisition-&gt;width  = 450;  requisition-&gt;height = 300;}      </pre>            </td>          </tr>        </table>        <p>          GTK+ takes care of storing a widget's last size request          in <span class="STRUCTNAME">          widget-&gt;requisition</span>.        </p>        <p>          If <tt class="CLASSNAME">GtkEv</tt> were a real-life          widget rather than an illustrative example, it would be          unnecessary to implement a size request method. The          default <tt class="CLASSNAME">GtkWidget</tt> method          simply returns the current value of <span class=           "STRUCTNAME">widget-&gt;requisition</span>, so <tt class=           "CLASSNAME">GtkEv</tt> could initialize <span class=           "STRUCTNAME">widget-&gt;requisition</span> in <tt class=           "FUNCTION">gtk_ev_init()</tt> and use the default method.        </p>        <p>          Alternatively, the size request method could be          implemented more elaborately; <tt class="CLASSNAME">          GtkEv</tt> could attempt to predict the maximum width of          the text to be displayed, for example.        </p>        <p>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人免费视频网站| 精品在线观看视频| 国产精品久久久久久久久免费樱桃 | 欧美主播一区二区三区美女| 99精品欧美一区二区蜜桃免费| 激情综合色综合久久| 韩国精品一区二区| 韩国视频一区二区| 国产福利91精品| 成人高清免费在线播放| 高清不卡一区二区在线| caoporm超碰国产精品| 色综合久久久久久久| 在线观看av不卡| 日韩视频一区二区在线观看| 日韩你懂的在线播放| 久久久久久久久蜜桃| 国产精品国产三级国产普通话三级 | 亚洲精品免费在线| 粗大黑人巨茎大战欧美成人| 91在线porny国产在线看| 综合激情网...| 亚洲图片欧美视频| 首页欧美精品中文字幕| 黄色精品一二区| 91丨九色丨蝌蚪丨老版| 精品1区2区3区| 欧美v日韩v国产v| 国产精品欧美一区喷水| 亚洲国产综合色| 国产精品99久久久久久宅男| 欧美日本国产视频| 久久久蜜臀国产一区二区| 亚洲日本va午夜在线影院| 日韩精品国产欧美| hitomi一区二区三区精品| 欧美日韩一级二级三级| 久久这里都是精品| 亚洲va韩国va欧美va| 成人午夜大片免费观看| 777午夜精品视频在线播放| 国产欧美一区二区精品性| 亚洲国产一区二区三区| 国产经典欧美精品| 91麻豆精品国产91久久久| 国产精品毛片无遮挡高清| 日韩在线a电影| 色婷婷久久久久swag精品 | 久久网站热最新地址| 亚洲人成精品久久久久| 黄色日韩三级电影| 欧美丰满少妇xxxbbb| 伊人婷婷欧美激情| 成人网在线播放| 欧美www视频| 蜜桃视频一区二区| 欧美久久一二三四区| 亚洲人一二三区| caoporm超碰国产精品| 国产视频一区二区在线观看| 欧美aaaaaa午夜精品| 欧美日韩国产一区| 亚洲一级片在线观看| 99国产精品国产精品毛片| 久久久国产一区二区三区四区小说 | 国产精华液一区二区三区| 欧美一区二区三区的| 亚洲自拍偷拍av| 色婷婷av一区二区| 亚洲主播在线播放| 91久久精品一区二区二区| 综合色天天鬼久久鬼色| 成人性生交大合| 国产欧美精品国产国产专区 | 一区二区在线观看免费| 成人高清伦理免费影院在线观看| 久久精品视频免费观看| 狠狠网亚洲精品| 国产女人18毛片水真多成人如厕 | 久久99久久精品| 久久在线观看免费| 成人午夜在线视频| 亚洲婷婷综合色高清在线| av成人动漫在线观看| 一区二区三区欧美日| 欧美三片在线视频观看| 亚洲国产wwwccc36天堂| 欧美精品一二三区| 久久疯狂做爰流白浆xx| 久久人人超碰精品| av电影在线观看不卡| 亚洲精品视频在线观看网站| 日本久久电影网| 美女网站在线免费欧美精品| 久久综合久久99| av一区二区三区黑人| 一区二区三区精密机械公司| 欧美在线观看视频一区二区| 五月天网站亚洲| 久久亚洲精华国产精华液| 成人性生交大片免费看中文网站| 一区二区三区中文字幕| 日韩视频一区二区在线观看| 国产精品影视在线观看| 亚洲女同ⅹxx女同tv| 91精品国产入口| www.日本不卡| 亚洲电影你懂得| 精品精品国产高清a毛片牛牛| 免费观看一级特黄欧美大片| 在线观看一区二区视频| 亚洲永久免费视频| 精品美女在线观看| 91免费在线视频观看| 日韩综合小视频| 中文字幕视频一区二区三区久| 在线观看视频91| 粉嫩蜜臀av国产精品网站| 天天操天天干天天综合网| 欧美激情中文不卡| 日韩免费看的电影| 欧美主播一区二区三区美女| 国产91精品在线观看| 蜜臀99久久精品久久久久久软件| 一区二区三区四区精品在线视频| 久久久噜噜噜久久人人看 | 欧美日韩一本到| 99久久er热在这里只有精品15| 看片网站欧美日韩| 午夜精品爽啪视频| 一区二区在线看| 亚洲国产高清在线| 久久综合丝袜日本网| 欧美日韩国产免费一区二区| www.av精品| 成人小视频在线观看| 韩国三级电影一区二区| 日韩avvvv在线播放| 亚洲自拍偷拍av| 一区二区三区在线视频播放 | 欧美视频一区在线| 91国产免费看| 成人午夜激情视频| 国产999精品久久久久久绿帽| 国产麻豆一精品一av一免费 | caoporen国产精品视频| 国产91综合网| 国产成人av电影在线播放| 久久99国产精品久久99果冻传媒| 日韩av成人高清| 男女视频一区二区| 久久99国内精品| 久久疯狂做爰流白浆xx| 久久99精品国产麻豆不卡| 看片的网站亚洲| 国产精品 日产精品 欧美精品| 国产毛片一区二区| 国产suv精品一区二区6| 99这里都是精品| 一本色道亚洲精品aⅴ| 91天堂素人约啪| 欧美无砖专区一中文字| 欧美日韩免费在线视频| 欧美日韩亚洲综合在线 | 国产欧美精品一区| 国产精品不卡在线| 亚洲精品v日韩精品| 亚洲一区二区在线免费看| 亚洲国产精品一区二区久久| 亚洲高清不卡在线观看| 蜜桃视频第一区免费观看| 狠狠久久亚洲欧美| 不卡的电视剧免费网站有什么| 91麻豆免费在线观看| 欧美特级限制片免费在线观看| 欧美一区二区福利在线| 精品久久一区二区| 综合中文字幕亚洲| 日韩电影在线免费观看| 国产精品自在在线| 99精品视频在线播放观看| 欧美乱妇23p| 久久久久久久免费视频了| 中文字幕日韩欧美一区二区三区| 一区二区三区精品视频| 蜜桃久久久久久| 色欧美乱欧美15图片| 欧美一区二区在线看| 中文幕一区二区三区久久蜜桃| 亚洲影视资源网| 国产一区二区三区| 欧美综合一区二区三区| 久久久青草青青国产亚洲免观| 一区二区三区四区不卡视频| 韩日欧美一区二区三区| 99久久99久久久精品齐齐| 欧美一区二区三区四区高清| 中文字幕免费一区| 久久国内精品自在自线400部| 色综合 综合色|