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

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

?? gnome-canvas-using.html

?? linux下gnome編程
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<HTML><HEAD><TITLE>Using the Canvas</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.61"><LINKREL="HOME"TITLE="Writing GNOME Applications"HREF="index.html"><LINKREL="UP"TITLE="The GNOME Canvas"HREF="gnome-canvas.html"><LINKREL="PREVIOUS"TITLE="Coordinate Systems"HREF="gnome-canvas-coordinates.html"><LINKREL="NEXT"TITLE="Canvas Items"HREF="gnome-canvas-items.html"></HEAD><BODYCLASS="SECT1"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Writing GNOME Applications</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="gnome-canvas-coordinates.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 11. The GNOME Canvas</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="gnome-canvas-items.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="GNOME-CANVAS-USING">Using the Canvas</A></H1><P>        The GNOME Canvas is fundamentally a GTK+ widget, and as such        it uses an API similar to that used by most other GTK+        widgets. You create it with a _new( ) function and destroy it        with the gtk_object_destroy( ) function. You can connect to        its GTK+ signals and interact with the user through the GDK        event system. In this section we'll explore the ins and outs        of interacting with the GNOME Canvas widget.      </P><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN1080">GDK versus AA</A></H2><P>          The GNOME Canvas supports two different drawing modes: GDK          mode, which uses native GDK elements; and anti-aliased mode,          or AA mode, which uses the advanced rendering features of          the GdkRGB system and allows varying degrees of          transparency between Canvas items. GDK mode, which is the          default Canvas mode, is quicker, more direct, and less          intensive but lacks the smoothed edges and translucency of          AA mode. The anti-aliased Canvas is also more flexible about          which transforms you can perform on its items, but its per-          formance is slower,1 and it does not currently support all          of the native GDK drawing properties, like dotted lines and          stippled fills.        </P><P>          You determine which Canvas mode to use at the time of widget          creation; you cannot change modes later without causing a          lot of problems, so make your choice carefully. Each mode          has its own creation function:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GtkWidget *gnome_canvas_new(  );GtkWidget *gnome_canvas_new_aa(  );        </PRE></TD></TR></TABLE><P>          The only difference between these two functions is a single          Boolean flag, aa, in the GnomeCanvas structure, which is          turned on for AA Canvas items and off for GDK Canvas          items. This is an internal value, and you should never try          to change it yourself. The Canvas uses this flag throughout          its operations to differentiate between the two styles of          rendering. You are not really creating two different types          of Canvas widgets, but rather telling a single type of          widget to behave differently in each case.        </P><P>          Each mode handles color depths and visuals according to its          own needs.  To help accommodate these needs and make sure          the Canvas can find the proper color maps and visuals (see          Chapter 10), you should wrap the creation function with push          and pop calls to load and unload them, respectively, de-          pending on how you intend to use the Canvas.        </P><P>          The anti-aliased Canvas always uses GdkRGB to render, so you          should push its specially tuned visual and color map for          AA-mode Canvas widgets.  You should also remember to          initialize GdkRGB beforehand, using the gdk_rgb_init( )          function:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GtkWidget *canvas_widget;gdk_rgb_init(  );gtk_widget_push_visual(gdk_rgb_get_visual(  ));gtk_widget_push_colormap(gdk_rgb_get_cmap(  ));canvas_widget = gnome_canvas_new_aa(  );gtk_widget_pop_visual(  );gtk_widget_pop_colormap(  );        </PRE></TD></TR></TABLE><P>          If you forget to do this, your Canvas will probably still          work, but it may experience strange color problems in          certain situations. The GDK-mode Canvas can also use the          GdkRGB visual and color map if you plan on using the gdk-          pixbuf library to load your images. In this case you will          want to use the GnomeCanvasPixbuf item (see Section 11.4.6).        </P><P>          On the other hand, if you want to use Imlib as your image          loader, you should load up GdkImlib's visual and color map          instead of GdkRGB's:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GtkWidget *canvas_widget;gtk_widget_push_visual(gdk_imlib_get_visual(  ));gtk_widget_push_colormap(gdk_imlib_get_colormap(  ));canvas_widget = gnome_canvas_new(  );gtk_widget_pop_visual(  );gtk_widget_pop_colormap(  );        </PRE></TD></TR></TABLE><P>          Since Imlib's color map tends to clash with GdkRGB, it's not          a good idea to use Imlib with an AA-mode Canvas. Thus with          Imlib you should stick to using GDK mode and the          GnomeCanvasImage item (also in Section 11.4.6).        </P><P>          If you want your Canvas to have scroll bars, you can embed          them in a GtkScrolledWindow widget with minimal          effort. GtkScrolledWindow will attach itself to the Canvas          and automatically wire up its scroll bars with the Canvas's          scrolling code. The following snippet of code is all you'll          need in most cases:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GtkWidget *scrollwin;scrollwin = gtk_scrolled_window_new(NULL, NULL);gtk_container_add(GTK_CONTAINER(scrollwin), canvas_widget);        </PRE></TD></TR></TABLE><P>          You can then put the GtkScrolledWindow widget into your          GnomeApp widget, or pack it into whatever container you          want to hold your Canvas.        </P></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN1096">The Scrolling Region</A></H2><P>          If you stop right here, your Canvas will not have all the          information it needs to render your Canvas items          properly. You need to tell it how much of the potentially          infinite reaches of the world coordinate space the Canvas          should be allowed to draw on and scroll through. You do          this by setting the Canvas's scrolling region. The Canvas          cannot scroll outside of this region:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gnome_canvas_set_scroll_region (GnomeCanvas *canvas,    double x1, double y1, double x2, double y2);        </PRE></TD></TR></TABLE><P>          You can safely call this function at any time, which implies          that it's legal to have Canvas items outside the boundaries          of the scrolling region. They just won't be visible until          they move inside the region or the region expands to in-          clude them.        </P><P>          Another property you can change is the scaling factor          between the (abstract) world coordinates and the          (pixel-based) canvas coordinates. By default, this value is          set to 1.0, which means that world coordinates will have a          one-to-one relationship to pixels. When world coordinates          are transformed into canvas coordinates, they are          multiplied-in both directions, x and y alike-by this scaling          factor. Thus if you set the scaling factor to a high number,          the Canvas will render everything bigger, as if you had          zoomed in. If you set the scaling factor to a fraction,          between 0.0 and 1.0, the Canvas will render things smaller.          The function gnome_canvas_set_pixels_per_unit( ) changes          this scaling factor and triggers a redraw of the entire          visible area:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gnome_canvas_set_pixels_per_unit(GnomeCanvas *canvas,     double n);        </PRE></TD></TR></TABLE><P>          Usually scroll bars are enough to cover your Canvas          scrolling needs, especially if your scrolling region          always matches your viewable region. Sometimes, however,          you will want to control the scrolling manually,          programmatically, to override the default scrolling          behavior. Perhaps you need to snap the Canvas up to the top          of the scrolling area, or move it to follow something the          user is doing.        </P><P>          The gnome_canvas_scroll_to( ) function allows you to          explicitly move the view port to any portion of the Canvas's          area, identified by Canvas pixel coordinates. The Canvas          will attempt to scroll to place those coordinates into the          upper left corner of the Canvas display, but it may adjust          the position a little to maximize the viewable space. The          complementary function, gnome_canvas_get_scroll_offsets( ),          retrieves the current scroll position:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gnome_canvas_scroll_to(GnomeCanvas *canvas,    int cx, int cy);void gnome_canvas_get_scroll_offsets(GnomeCanvas *canvas,    int *cx, int *cy);        </PRE></TD></TR></TABLE><P>          Thus given a viewable area of 100 100 pixels and a Canvas          size of 200 200 pixels, an attempt to scroll to the          coordinates (150, 150) would theoretically end up showing          only a 50 50-pixel square of valid Canvas in the upper left          corner of the viewing space, with the other 75 percent          showing blank, invalid space (see Figure 11.2). To          minimize this wasted space, the Canvas automatically          shifts the offset from (150, 150) to (100, 100) so that the          entire viewing area contains valid Canvas space.        </P><DIVCLASS="FIGURE"><ANAME="AEN1107"></A><P><B>Figure 11-2. Maximizing the Viewing Space</B></P><DIVCLASS="MEDIAOBJECT"><P><IMGSRC="figures/11f2.png"></IMG></P></DIV></DIV><P>          These two functions deal in absolute coordinates. Relative          scrolling is also possible, by identifying the current          scrolling position with the gnome_canvas_get_scroll_offsets(          ) function and calculating a new position to send to          gnome_canvas_scroll_to( ). For example, if you wanted to          scroll 20 pixels to the right, regardless of where the          Canvas currently was, you could do something like this:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">int x;int y;GnomeCanvas *canvas;...gnome_canvas_get_scroll_offsets(canvas, &#38;x, &#38;y);gnome_canvas_scroll_to(canvas, x + 20, y);        </PRE></TD></TR></TABLE></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN1114">Adding Canvas Items</A></H2><P>          Now that the GnomeCanvas widget exists, you can start adding          items to it.  GNOME has only one function for creating          Canvas items. Each time you create a new item, you must pass          in the Canvas group to which you want it added, the GTK+          type for the Canvas item, and an optional list of properties          with which to initialize the item:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">GnomeCanvasItem *gnome_canvas_item_new(GnomeCanvasGroup *parent,    GtkType type, const gchar *first_arg_name, ...);        </PRE></TD></TR></TABLE><P>          If you need to set or change any properties after the fact,          you can use the item's accessor function:        </P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><PRECLASS="PROGRAMLISTING">void gnome_canvas_item_set(GnomeCanvasItem *item,    const gchar *first_arg_name, ...);        </PRE></TD></TR></TABLE><P>          Both variable parameter lists-indicated by the ellipses-work          in the same way. Each property in the list requires exactly          two parameters: The first parameter is a string declaring          the property's name, and the second parameter is the actual          value of that property. The property-value pairs can come in          any order.  You must always terminate the variable parameter          list with a NULL value so that the parameter-parsing code          will know when to stop. Also, since the value parameter can          be a different type for each property, you have to be very          careful not to pass in the wrong type. For example, if you

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲欧美中文| 欧美日韩dvd在线观看| 精品一区二区在线视频| 亚洲欧美日韩国产另类专区| 中文字幕日韩av资源站| 国产欧美精品一区aⅴ影院| 中文字幕在线观看一区| 亚洲人成网站影音先锋播放| 亚洲欧洲一区二区在线播放| 久久久www成人免费毛片麻豆| 久久久久国产一区二区三区四区| 欧美一区二区三区在线电影| 欧美大白屁股肥臀xxxxxx| 久久久蜜臀国产一区二区| 亚洲欧美一区二区三区孕妇| 看片网站欧美日韩| 一本色道久久综合亚洲91| 精品久久久久一区二区国产| 亚洲日本免费电影| 国产麻豆午夜三级精品| 欧美三级电影在线看| 久久久噜噜噜久噜久久综合| 日韩高清欧美激情| 在线一区二区观看| 亚洲色图在线播放| 国产精品一区免费视频| 欧美一级艳片视频免费观看| 亚洲国产视频直播| 成人91在线观看| 国产无一区二区| 亚洲成人在线免费| 欧美日高清视频| 日本一区免费视频| 国产露脸91国语对白| 欧美老女人在线| 亚洲一区在线观看免费观看电影高清| 国产精品资源网站| 国产丝袜在线精品| 国内精品伊人久久久久av影院| 欧美日韩夫妻久久| 亚洲日本va午夜在线电影| 成人免费不卡视频| 中文字幕 久热精品 视频在线 | 韩国成人福利片在线播放| 91精品国产综合久久精品| 亚洲欧美经典视频| 欧美日韩精品福利| 日韩中文字幕1| 久久精品免视看| 成人丝袜视频网| 亚洲一二三级电影| 日韩一区二区三区在线观看| 久久精品免费观看| 久久亚洲精品小早川怜子| 成人动漫一区二区在线| 中文字幕亚洲在| 日韩一区二区三区视频| 成人黄色国产精品网站大全在线免费观看| 亚洲精品视频在线观看网站| 欧美精品 国产精品| av福利精品导航| 美女尤物国产一区| 国产日韩欧美精品一区| 欧美日韩亚州综合| 国产一区二区成人久久免费影院 | 人人精品人人爱| 国产亚洲欧美色| 欧美综合色免费| 国产精品一二三四区| 天天综合色天天| 亚洲日本一区二区| 精品国产电影一区二区| 欧美日韩日本视频| 色网站国产精品| 福利一区二区在线| 国产自产视频一区二区三区| 乱中年女人伦av一区二区| 日韩在线卡一卡二| 一区二区三区在线观看欧美| 精品国产露脸精彩对白| 欧美另类videos死尸| 欧美午夜寂寞影院| 色999日韩国产欧美一区二区| av在线不卡网| 99久久久国产精品免费蜜臀| 国产99久久久精品| 国产精品一区2区| 国产高清视频一区| 成人中文字幕在线| 成年人网站91| eeuss国产一区二区三区| www.在线成人| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 欧美日韩一区小说| 亚洲精品一区二区三区蜜桃下载| 日韩欧美成人激情| 国产精品福利电影一区二区三区四区| 国产亚洲欧美色| 一区二区三区四区高清精品免费观看 | 欧美疯狂性受xxxxx喷水图片| 日韩一区二区三区免费看| www国产精品av| 亚洲人一二三区| 午夜精品久久一牛影视| 国产精品亚洲专一区二区三区| 国产91富婆露脸刺激对白| 在线电影院国产精品| 精品少妇一区二区三区视频免付费| 国产亚洲成av人在线观看导航| 一区二区三区在线免费视频| 国产精品香蕉一区二区三区| 日韩一区二区三区高清免费看看| 亚洲欧美日韩人成在线播放| 国内一区二区在线| 欧美不卡激情三级在线观看| 亚洲综合色噜噜狠狠| 色综合亚洲欧洲| 最新久久zyz资源站| 国产综合久久久久影院| 在线不卡免费欧美| 亚洲精品精品亚洲| 一本大道久久a久久综合 | 洋洋av久久久久久久一区| 国产精品一区二区免费不卡| 精品人在线二区三区| 日av在线不卡| 欧美美女视频在线观看| 肉色丝袜一区二区| 欧美午夜精品久久久久久孕妇| 亚洲精品乱码久久久久久| 一本色道久久综合精品竹菊| 亚洲欧美日本在线| 色婷婷av一区二区三区之一色屋| 国产精品福利影院| 盗摄精品av一区二区三区| 中文字幕五月欧美| a4yy欧美一区二区三区| 一区二区三区电影在线播| 国产成人在线视频网站| 伊人一区二区三区| 欧美日韩电影在线| 日韩电影免费一区| 国产调教视频一区| 成人性生交大片免费看视频在线| 一区二区三区欧美日韩| 欧美中文字幕一二三区视频| 狠狠v欧美v日韩v亚洲ⅴ| 国产日韩欧美精品一区| 精品视频在线视频| 久久成人av少妇免费| 亚洲自拍偷拍av| 欧美一区二区性放荡片| 91色视频在线| 免费久久99精品国产| 一区二区三区四区不卡在线| 精品欧美乱码久久久久久1区2区| 丁香五精品蜜臀久久久久99网站| 日本三级韩国三级欧美三级| 2017欧美狠狠色| 91麻豆精品国产91久久久久| 国产精品99精品久久免费| 蜜臀av性久久久久蜜臀aⅴ| 亚洲欧美另类综合偷拍| 国产精品毛片a∨一区二区三区| 日韩一级二级三级精品视频| 欧美精品久久一区二区三区| 在线观看中文字幕不卡| 99精品欧美一区二区三区小说| 激情综合色播激情啊| 精品一区二区三区免费毛片爱| 亚洲成av人片| 亚洲第一成人在线| 热久久久久久久| 天天综合网天天综合色 | 91浏览器打开| 欧美图片一区二区三区| 91精品婷婷国产综合久久 | 亚洲国产乱码最新视频 | 99国产精品一区| 日本道精品一区二区三区| 在线亚洲免费视频| 欧美丰满嫩嫩电影| 日韩一区二区在线看| 中文字幕av资源一区| 亚洲欧美综合色| 美女免费视频一区二区| 久久99精品一区二区三区| 99久久精品一区| 欧美一区二区播放| 国产蜜臀av在线一区二区三区| 18成人在线观看| 日韩**一区毛片| 成人av免费在线观看| 日韩久久精品一区| 亚洲人成在线播放网站岛国 | 欧美亚洲一区二区在线观看| 精品日韩成人av| 日韩电影在线免费看| 狠狠色狠狠色综合| 欧美色图第一页|