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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? gtk_tut-10.html

?? GTK development guide
?? HTML
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
 <TITLE>GTK v1.2 Tutorial: Container Widgets</TITLE>
 <LINK HREF="gtk_tut-11.html" REL=next>
 <LINK HREF="gtk_tut-9.html" REL=previous>
 <LINK HREF="gtk_tut.html#toc10" REL=contents>
</HEAD>
<BODY TEXT="#CCCCCC" BGCOLOR="#000000" LINK="#33cc00" VLINK="#009900" ALINK="#FF0000">
<A HREF="gtk_tut-11.html">Next</A>
<A HREF="gtk_tut-9.html">Previous</A>
<A HREF="gtk_tut.html#toc10">Contents</A>
<HR>
<H2><A NAME="s10">10. Container Widgets</A> </H2>

<H2><A NAME="sec_EventBox"></A> <A NAME="ss10.1">10.1 The EventBox </A>
</H2>

<P> 
Some GTK widgets don't have associated X windows, so they just draw on
their parents. Because of this, they cannot receive events and if they
are incorrectly sized, they don't clip so you can get messy
overwriting, etc. If you require more from these widgets, the EventBox
is for you.
<P>At first glance, the EventBox widget might appear to be totally
useless. It draws nothing on the screen and responds to no
events. However, it does serve a function - it provides an X window
for its child widget. This is important as many GTK widgets do not
have an associated X window. Not having an X window saves memory and
improves performance, but also has some drawbacks. A widget without an
X window cannot receive events, and does not perform any clipping on
its contents. Although the name <EM>EventBox</EM> emphasizes the
event-handling function, the widget can also be used for clipping.
(and more, see the example below).
<P>To create a new EventBox widget, use:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_event_box_new( void );
</PRE>
</CODE></BLOCKQUOTE>
<P>A child widget can then be added to this EventBox:
<P>
<BLOCKQUOTE><CODE>
<PRE>
    gtk_container_add( GTK_CONTAINER(event_box), child_widget );
</PRE>
</CODE></BLOCKQUOTE>
<P>The following example demonstrates both uses of an EventBox - a label
is created that is clipped to a small box, and set up so that a
mouse-click on the label causes the program to exit. Resizing the
window reveals varying amounts of the label.
<P>
<BLOCKQUOTE><CODE>
<PRE>
/* example-start eventbox eventbox.c */

#include &lt;gtk/gtk.h>

int main( int argc,
          char *argv[] )
{
    GtkWidget *window;
    GtkWidget *event_box;
    GtkWidget *label;
    
    gtk_init (&amp;argc, &amp;argv);
    
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    
    gtk_window_set_title (GTK_WINDOW (window), "Event Box");
    
    gtk_signal_connect (GTK_OBJECT (window), "destroy",
                        GTK_SIGNAL_FUNC (gtk_exit), NULL);
    
    gtk_container_set_border_width (GTK_CONTAINER (window), 10);
    
    /* Create an EventBox and add it to our toplevel window */
    
    event_box = gtk_event_box_new ();
    gtk_container_add (GTK_CONTAINER(window), event_box);
    gtk_widget_show (event_box);
    
    /* Create a long label */
    
    label = gtk_label_new ("Click here to quit, quit, quit, quit, quit");
    gtk_container_add (GTK_CONTAINER (event_box), label);
    gtk_widget_show (label);
    
    /* Clip it short. */
    gtk_widget_set_usize (label, 110, 20);
    
    /* And bind an action to it */
    gtk_widget_set_events (event_box, GDK_BUTTON_PRESS_MASK);
    gtk_signal_connect (GTK_OBJECT(event_box), "button_press_event",
                        GTK_SIGNAL_FUNC (gtk_exit), NULL);
    
    /* Yet one more thing you need an X window for ... */
    
    gtk_widget_realize (event_box);
    gdk_window_set_cursor (event_box->window, gdk_cursor_new (GDK_HAND1));
    
    gtk_widget_show (window);
    
    gtk_main ();
    
    return(0);
}
/* example-end */
</PRE>
</CODE></BLOCKQUOTE>
<P>   
<H2><A NAME="sec_Alignment"></A> <A NAME="ss10.2">10.2 The Alignment widget </A>
</H2>

<P>The alignment widget allows you to place a widget within its window at
a position and size relative to the size of the Alignment widget
itself. For example, it can be very useful for centering a widget
within the window.
<P>There are only two functions associated with the Alignment widget:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget* gtk_alignment_new( gfloat xalign,
                              gfloat yalign,
                              gfloat xscale,
                              gfloat yscale );

void gtk_alignment_set( GtkAlignment *alignment,
                        gfloat        xalign,
                        gfloat        yalign,
                        gfloat        xscale,
                        gfloat        yscale );
</PRE>
</CODE></BLOCKQUOTE>
<P>The first function creates a new Alignment widget with the specified
parameters. The second function allows the alignment paramters of an
exisiting Alignment widget to be altered.
<P>All four alignment parameters are floating point numbers which can
range from 0.0 to 1.0. The <CODE>xalign</CODE> and <CODE>yalign</CODE> arguments
affect the position of the widget placed within the Alignment
widget. The <CODE>xscale</CODE> and <CODE>yscale</CODE> arguments effect the amount of
space allocated to the widget.
<P>A child widget can be added to this Alignment widget using:
<P>
<BLOCKQUOTE><CODE>
<PRE>
    gtk_container_add( GTK_CONTAINER(alignment), child_widget );
</PRE>
</CODE></BLOCKQUOTE>
<P>For an example of using an Alignment widget, refer to the example for
the 
<A HREF="gtk_tut-9.html#sec_ProgressBar">Progress Bar</A> widget.
<P>
<H2><A NAME="ss10.3">10.3 Fixed Container</A>
</H2>

<P>The Fixed container allows you to place widgets at a fixed position
within it's window, relative to it's upper left hand corner. The
position of the widgets can be changed dynamically.
<P>There are only three functions associated with the fixed widget:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget* gtk_fixed_new( void );

void gtk_fixed_put( GtkFixed  *fixed,
                    GtkWidget *widget,
                    gint16     x,
                    gint16     y );

void gtk_fixed_move( GtkFixed  *fixed,
                     GtkWidget *widget,
                     gint16     x,
                     gint16     y );
</PRE>
</CODE></BLOCKQUOTE>
<P>The function <CODE>gtk_fixed_new</CODE> allows you to create a new Fixed
container.
<P><CODE>gtk_fixed_put</CODE> places <CODE>widget</CODE> in the container <CODE>fixed</CODE> at
the position specified by <CODE>x</CODE> and <CODE>y</CODE>.
<P><CODE>gtk_fixed_move</CODE> allows the specified widget to be moved to a new
position.
<P>The following example illustrates how to use the Fixed Container.
<P>
<BLOCKQUOTE><CODE>
<PRE>
/* example-start fixed fixed.c */

#include &lt;gtk/gtk.h>

/* I'm going to be lazy and use some global variables to
 * store the position of the widget within the fixed
 * container */
gint x=50;
gint y=50;

/* This callback function moves the button to a new position
 * in the Fixed container. */
void move_button( GtkWidget *widget,
                  GtkWidget *fixed )
{
  x = (x+30)%300;
  y = (y+50)%300;
  gtk_fixed_move( GTK_FIXED(fixed), widget, x, y); 
}

int main( int   argc,
          char *argv[] )
{
  /* GtkWidget is the storage type for widgets */
  GtkWidget *window;
  GtkWidget *fixed;
  GtkWidget *button;
  gint i;

  /* Initialise GTK */
  gtk_init(&amp;argc, &amp;argv);
    
  /* Create a new window */
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_title(GTK_WINDOW(window), "Fixed Container");

  /* Here we connect the "destroy" event to a signal handler */ 
  gtk_signal_connect (GTK_OBJECT (window), "destroy",
                      GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
 
  /* Sets the border width of the window. */
  gtk_container_set_border_width (GTK_CONTAINER (window), 10);

  /* Create a Fixed Container */
  fixed = gtk_fixed_new();
  gtk_container_add(GTK_CONTAINER(window), fixed);
  gtk_widget_show(fixed);
  
  for (i = 1 ; i &lt;= 3 ; i++) {
    /* Creates a new button with the label "Press me" */
    button = gtk_button_new_with_label ("Press me");
  
    /* When the button receives the "clicked" signal, it will call the
     * function move_button() passing it the Fixed Container as its
     * argument. */
    gtk_signal_connect (GTK_OBJECT (button), "clicked",
                        GTK_SIGNAL_FUNC (move_button), fixed);
  
    /* This packs the button into the fixed containers window. */
    gtk_fixed_put (GTK_FIXED (fixed), button, i*50, i*50);
  
    /* The final step is to display this newly created widget. */
    gtk_widget_show (button);
  }

  /* Display the window */
  gtk_widget_show (window);
    
  /* Enter the event loop */
  gtk_main ();
    
  return(0);
}
/* example-end */
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss10.4">10.4 Layout Container</A>
</H2>

<P>The Layout container is similar to the Fixed container except that it
implements an infinite (where infinity is less than 2^32) scrolling
area. The X window system has a limitation where windows can be at
most 32767 pixels wide or tall. The Layout container gets around this
limitation by doing some exotic stuff using window and bit gravities,
so that you can have smooth scrolling even when you have many child
widgets in your scrolling area.
<P>A Layout container is created using:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_layout_new( GtkAdjustment *hadjustment,
                           GtkAdjustment *vadjustment );
</PRE>
</CODE></BLOCKQUOTE>
<P>As you can see, you can optionally specify the Adjustment objects that
the Layout widget will use for its scrolling.
<P>You can add and move widgets in the Layout container using the
following two functions:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_layout_put( GtkLayout *layout,
                     GtkWidget *widget,
                     gint       x,
                     gint       y );

void gtk_layout_move( GtkLayout *layout,
                      GtkWidget *widget,
                      gint       x,
                      gint       y );
</PRE>
</CODE></BLOCKQUOTE>
<P>The size of the Layout container can be set using the next function:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_layout_set_size( GtkLayout *layout,
                          guint      width,
                          guint      height );
</PRE>
</CODE></BLOCKQUOTE>
<P>Layout containers are one of the very few widgets in the GTK widget
set that actively repaint themselves on screen as they are changed
using the above functions (the vast majority of widgets queue
requests which are then processed when control returns to the
<CODE>gtk_main()</CODE> function).
<P>When you want to make a large number of changes to a Layout container,
you can use the following two functions to disable and re-enable this
repainting functionality:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_layout_freeze( GtkLayout *layout );

void gtk_layout_thaw( GtkLayout *layout );
</PRE>
</CODE></BLOCKQUOTE>
<P>The final four functions for use with Layout widgets are for
manipulating the horizontal and vertical adjustment widgets:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkAdjustment* gtk_layout_get_hadjustment( GtkLayout *layout );

GtkAdjustment* gtk_layout_get_vadjustment( GtkLayout *layout );

void gtk_layout_set_hadjustment( GtkLayout     *layout,
                                 GtkAdjustment *adjustment );

void gtk_layout_set_vadjustment( GtkLayout     *layout,
                                 GtkAdjustment *adjustment);
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="sec_Frames"></A> <A NAME="ss10.5">10.5 Frames </A>
</H2>

<P>Frames can be used to enclose one or a group of widgets with a box
which can optionally be labelled. The position of the label and the
style of the box can be altered to suit.
<P>A Frame can be created with the following function:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_frame_new( const gchar *label );
</PRE>
</CODE></BLOCKQUOTE>
<P>The label is by default placed in the upper left hand corner of the
frame. A value of NULL for the <CODE>label</CODE> argument will result in no
label being displayed. The text of the label can be changed using the
next function.
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_frame_set_label( GtkFrame    *frame,
                          const gchar *label );
</PRE>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区高清| 亚洲精品一二三区| 91精品国产一区二区三区| 从欧美一区二区三区| 另类人妖一区二区av| 亚洲第一在线综合网站| 国产成人免费在线观看不卡| 日本在线不卡一区| 亚洲bdsm女犯bdsm网站| 亚洲一区二区三区免费视频| 中文字幕一区二区5566日韩| 国产精品第一页第二页第三页| 日韩一区二区在线看| 69精品人人人人| 在线免费观看一区| 九色综合狠狠综合久久| 狠狠色综合色综合网络| 美女脱光内衣内裤视频久久影院| 一区二区欧美国产| 亚洲一区视频在线| 亚洲欧洲色图综合| 亚洲天堂网中文字| 亚洲另类在线一区| 亚洲一区中文日韩| 亚洲午夜电影在线| 午夜欧美视频在线观看| 亚洲成人在线网站| 日韩激情一二三区| 麻豆国产精品官网| 久久国产三级精品| 国产成人自拍网| av影院午夜一区| 色系网站成人免费| 欧美日本国产一区| 又紧又大又爽精品一区二区| 亚洲精品久久久蜜桃| 午夜久久久久久久久久一区二区| 日日噜噜夜夜狠狠视频欧美人| 日本三级亚洲精品| 日本视频在线一区| 国产一区二区三区四区五区入口| 国产成人丝袜美腿| 色香蕉成人二区免费| 51精品秘密在线观看| 精品福利一区二区三区| 久久精品亚洲国产奇米99| 中文久久乱码一区二区| 亚洲综合久久久久| 免费成人在线视频观看| 国产91精品在线观看| 91在线国产观看| 欧美日韩国产大片| 久久综合九色欧美综合狠狠| 中文字幕一区二区三| 午夜不卡av免费| 精品综合久久久久久8888| 国产精品99久久久| 欧美吞精做爰啪啪高潮| 欧美xxxxx牲另类人与| 成人免费在线视频观看| 午夜影院久久久| 国产一区福利在线| 色哦色哦哦色天天综合| 欧美一级精品在线| 国产三级一区二区| 一区二区三区**美女毛片| 日本vs亚洲vs韩国一区三区 | 国产不卡视频一区二区三区| 在线免费观看日本欧美| 久久九九久精品国产免费直播| 亚洲一区二区在线观看视频| 国产一区二区在线电影| 91丨九色丨蝌蚪富婆spa| 日韩一区二区影院| 亚洲欧美一区二区三区极速播放| 理论片日本一区| 91福利视频在线| 久久久久久久综合狠狠综合| 亚洲mv在线观看| 成人18视频日本| 欧美电影免费提供在线观看| 亚洲人成网站影音先锋播放| 久久成人羞羞网站| 欧美日韩精品一区二区三区四区 | 日韩一区二区三区av| 国产精品国产三级国产a| 麻豆高清免费国产一区| 欧美三级电影精品| 国产精品日韩成人| 精品无码三级在线观看视频| 欧洲另类一二三四区| 国产精品萝li| www.亚洲激情.com| 国产精品福利一区二区三区| 成人免费看片app下载| 中文字幕av一区 二区| 成人影视亚洲图片在线| 国产精品天天看| 懂色av一区二区在线播放| 久久精品日产第一区二区三区高清版 | 91麻豆123| 一区二区中文视频| 91丨九色丨黑人外教| 一区二区视频在线| 欧美视频第二页| 天堂蜜桃一区二区三区| 337p亚洲精品色噜噜噜| 伦理电影国产精品| 精品国产伦一区二区三区观看体验| 蜜桃视频在线观看一区二区| 精品日韩欧美在线| 国产精品中文字幕日韩精品 | 亚洲欧美怡红院| 91色乱码一区二区三区| 亚洲精品中文在线观看| 欧美色图在线观看| 免费av成人在线| 久久免费精品国产久精品久久久久| 国产精品一区二区在线观看网站| 国产日韩欧美一区二区三区综合| 成人午夜短视频| 亚洲色图.com| 欧美精品v国产精品v日韩精品| 美国一区二区三区在线播放| 国产亚洲精品久| 99久久婷婷国产| 天堂影院一区二区| 久久久久九九视频| 99久久久精品| 日韩精品乱码免费| 国产天堂亚洲国产碰碰| 色综合中文字幕国产| 91免费看视频| 亚洲午夜免费电影| 日韩免费看的电影| 成人性生交大片免费看视频在线 | 国产精品996| 亚洲综合在线五月| 91精品国产手机| 国产成人精品亚洲午夜麻豆| 亚洲人成在线观看一区二区| 欧美一区二区成人6969| 国产福利一区二区三区视频 | 自拍视频在线观看一区二区| 欧美精品成人一区二区三区四区| 国产在线不卡一区| 亚洲日本韩国一区| 日韩精品一区二区三区视频 | 91在线精品一区二区| 蜜桃精品在线观看| 久久精品视频免费| 欧美日韩国产小视频| 粉嫩13p一区二区三区| 婷婷中文字幕一区三区| 国产亚洲精品bt天堂精选| 欧美日韩午夜精品| 懂色av噜噜一区二区三区av| 天堂成人国产精品一区| 一区精品在线播放| 精品国产一区二区三区四区四| 91在线免费看| 国产精品 欧美精品| 日本aⅴ精品一区二区三区 | proumb性欧美在线观看| 美腿丝袜亚洲综合| 亚洲激情图片小说视频| 国产日产欧美一区| 日韩一区二区三区电影在线观看 | 久久九九影视网| 宅男噜噜噜66一区二区66| 色综合久久99| 大白屁股一区二区视频| 麻豆一区二区在线| 午夜精品成人在线视频| 亚洲视频一区在线| 久久久不卡影院| 欧美日本国产一区| 在线观看亚洲精品视频| 国产suv精品一区二区三区| 日本不卡免费在线视频| 亚洲午夜免费电影| 亚洲色图一区二区三区| 久久久久久久久一| 日韩精品专区在线影院重磅| 欧美日韩亚洲国产综合| 99久久精品免费看| 国产成人啪免费观看软件| 极品少妇xxxx精品少妇| 日本欧美在线观看| 午夜激情久久久| 亚洲大片免费看| 亚洲永久精品国产| 亚洲欧美另类小说| 亚洲欧美一区二区三区国产精品| 国产精品久久一卡二卡| 亚洲国产精品v| 久久久国产一区二区三区四区小说 | 国产乱码字幕精品高清av| 久久超碰97中文字幕| 久久精品国产第一区二区三区|