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

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

?? gtk_tut-7.html

?? GTK development guide
?? HTML
字號:
<!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: Adjustments </TITLE>
 <LINK HREF="gtk_tut-8.html" REL=next>
 <LINK HREF="gtk_tut-6.html" REL=previous>
 <LINK HREF="gtk_tut.html#toc7" REL=contents>
</HEAD>
<BODY TEXT="#CCCCCC" BGCOLOR="#000000" LINK="#33cc00" VLINK="#009900" ALINK="#FF0000">
<A HREF="gtk_tut-8.html">Next</A>
<A HREF="gtk_tut-6.html">Previous</A>
<A HREF="gtk_tut.html#toc7">Contents</A>
<HR>
<H2><A NAME="sec_Adjustment"></A> <A NAME="s7">7. Adjustments </A></H2>

<P>GTK has various widgets that can be visually adjusted by the user
using the mouse or the keyboard, such as the range widgets, described
in the 
<A HREF="gtk_tut-8.html#sec_Range_Widgets">Range Widgets</A>
section. There are also a few widgets that display some adjustable
portion of a larger area of data, such as the text widget and the
viewport widget.
<P>Obviously, an application needs to be able to react to changes the
user makes in range widgets. One way to do this would be to have each
widget emit its own type of signal when its adjustment changes, and
either pass the new value to the signal handler, or require it to look
inside the widget's data structure in order to ascertain the value.
But you may also want to connect the adjustments of several widgets
together, so that adjusting one adjusts the others. The most obvious
example of this is connecting a scrollbar to a panning viewport or a
scrolling text area. If each widget has its own way of setting or
getting the adjustment value, then the programmer may have to write
their own signal handlers to translate between the output of one
widget's signal and the "input" of another's adjustment setting
function.
<P>GTK solves this problem using the Adjustment object, which is not a
widget but a way for widgets to store and pass adjustment information
in an abstract and flexible form. The most obvious use of Adjustment
is to store the configuration parameters and values of range widgets,
such as scrollbars and scale controls. However, since Adjustments are
derived from Object, they have some special powers beyond those of
normal data structures. Most importantly, they can emit signals, just
like widgets, and these signals can be used not only to allow your
program to react to user input on adjustable widgets, but also to
propagate adjustment values transparently between adjustable widgets.
<P>You will see how adjustments fit in when you see the other widgets
that incorporate them:
<A HREF="gtk_tut-9.html#sec_ProgressBar">Progress Bars</A>,
<A HREF="gtk_tut-10.html#sec_Viewports">Viewports</A>,
<A HREF="gtk_tut-10.html#sec_ScrolledWindow">Scrolled Windows</A>, and others.
<P>
<H2><A NAME="ss7.1">7.1 Creating an Adjustment</A>
</H2>

<P>Many of the widgets which use adjustment objects do so automatically,
but some cases will be shown in later examples where you may need to
create one yourself. You create an adjustment using:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkObject *gtk_adjustment_new( gfloat value,
                               gfloat lower,
                               gfloat upper,
                               gfloat step_increment,
                               gfloat page_increment,
                               gfloat page_size );
</PRE>
</CODE></BLOCKQUOTE>
<P>The <CODE>value</CODE> argument is the initial value you want to give to the
adjustment, usually corresponding to the topmost or leftmost position
of an adjustable widget. The <CODE>lower</CODE> argument specifies the lowest
value which the adjustment can hold. The <CODE>step_increment</CODE> argument
specifies the "smaller" of the two increments by which the user can
change the value, while the <CODE>page_increment</CODE> is the "larger" one.
The <CODE>page_size</CODE> argument usually corresponds somehow to the visible
area of a panning widget. The <CODE>upper</CODE> argument is used to represent
the bottom most or right most coordinate in a panning widget's
child. Therefore it is <EM>not</EM> always the largest number that
<CODE>value</CODE> can take, since the <CODE>page_size</CODE> of such widgets is
usually non-zero.
<P>
<H2><A NAME="ss7.2">7.2 Using Adjustments the Easy Way</A>
</H2>

<P>The adjustable widgets can be roughly divided into those which use and
require specific units for these values and those which treat them as
arbitrary numbers. The group which treats the values as arbitrary
numbers includes the range widgets (scrollbars and scales, the
progress bar widget, and the spin button widget). These widgets are
all the widgets which are typically "adjusted" directly by the user
with the mouse or keyboard. They will treat the <CODE>lower</CODE> and
<CODE>upper</CODE> values of an adjustment as a range within which the user
can manipulate the adjustment's <CODE>value</CODE>. By default, they will only
modify the <CODE>value</CODE> of an adjustment.
<P>The other group includes the text widget, the viewport widget, the
compound list widget, and the scrolled window widget. All of these
widgets use pixel values for their adjustments. These are also all
widgets which are typically "adjusted" indirectly using scrollbars.
While all widgets which use adjustments can either create their own
adjustments or use ones you supply, you'll generally want to let this
particular category of widgets create its own adjustments. Usually,
they will eventually override all the values except the <CODE>value</CODE>
itself in whatever adjustments you give them, but the results are, in
general, undefined (meaning, you'll have to read the source code to
find out, and it may be different from widget to widget).
<P>Now, you're probably thinking, since text widgets and viewports insist
on setting everything except the <CODE>value</CODE> of their adjustments,
while scrollbars will <EM>only</EM> touch the adjustment's <CODE>value</CODE>, if
you <EM>share</EM> an adjustment object between a scrollbar and a text
widget, manipulating the scrollbar will automagically adjust the text
widget?  Of course it will! Just like this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
  /* creates its own adjustments */
  text = gtk_text_new (NULL, NULL);
  /* uses the newly-created adjustment for the scrollbar as well */
  vscrollbar = gtk_vscrollbar_new (GTK_TEXT(text)->vadj);
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss7.3">7.3 Adjustment Internals</A>
</H2>

<P>Ok, you say, that's nice, but what if I want to create my own handlers
to respond when the user adjusts a range widget or a spin button, and
how do I get at the value of the adjustment in these handlers?  To
answer these questions and more, let's start by taking a look at
<CODE>struct _GtkAdjustment</CODE> itself:
<P>
<BLOCKQUOTE><CODE>
<PRE>
struct _GtkAdjustment
{
  GtkData data;
  
  gfloat lower;
  gfloat upper;
  gfloat value;
  gfloat step_increment;
  gfloat page_increment;
  gfloat page_size;
};     
</PRE>
</CODE></BLOCKQUOTE>
<P>The first thing you should know is that there aren't any handy-dandy
macros or accessor functions for getting the <CODE>value</CODE> out of an
Adjustment, so you'll have to (horror of horrors) do it like a
<EM>real</EM> C programmer.  Don't worry - the <CODE>GTK_ADJUSTMENT
(Object)</CODE> macro does run-time type checking (as do all the GTK
type-casting macros, actually).
<P>Since, when you set the <CODE>value</CODE> of an adjustment, you generally
want the change to be reflected by every widget that uses this
adjustment, GTK provides this convenience function to do this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_adjustment_set_value( GtkAdjustment *adjustment,
                               gfloat         value );
</PRE>
</CODE></BLOCKQUOTE>
<P>As mentioned earlier, Adjustment is a subclass of Object just
like all the various widgets, and thus it is able to emit signals.
This is, of course, why updates happen automagically when you share an
adjustment object between a scrollbar and another adjustable widget;
all adjustable widgets connect signal handlers to their adjustment's
<CODE>value_changed</CODE> signal, as can your program. Here's the definition
of this signal in <CODE>struct _GtkAdjustmentClass</CODE>:
<P>
<BLOCKQUOTE><CODE>
<PRE>
  void (* value_changed) (GtkAdjustment *adjustment);
</PRE>
</CODE></BLOCKQUOTE>
<P>The various widgets that use the Adjustment object will emit this
signal on an adjustment whenever they change its value. This happens
both when user input causes the slider to move on a range widget, as
well as when the program explicitly changes the value with
<CODE>gtk_adjustment_set_value()</CODE>. So, for example, if you have a scale
widget, and you want to change the rotation of a picture whenever its
value changes, you would create a callback like this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void cb_rotate_picture (GtkAdjustment *adj, GtkWidget *picture)
{
  set_picture_rotation (picture, adj->value);
...
</PRE>
</CODE></BLOCKQUOTE>
<P>and connect it to the scale widget's adjustment like this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
gtk_signal_connect (GTK_OBJECT (adj), "value_changed",
                    GTK_SIGNAL_FUNC (cb_rotate_picture), picture);
</PRE>
</CODE></BLOCKQUOTE>
<P>What about when a widget reconfigures the <CODE>upper</CODE> or <CODE>lower</CODE>
fields of its adjustment, such as when a user adds more text to a text
widget?  In this case, it emits the <CODE>changed</CODE> signal, which looks
like this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
  void (* changed)       (GtkAdjustment *adjustment);
</PRE>
</CODE></BLOCKQUOTE>
<P>Range widgets typically connect a handler to this signal, which
changes their appearance to reflect the change - for example, the size
of the slider in a scrollbar will grow or shrink in inverse proportion
to the difference between the <CODE>lower</CODE> and <CODE>upper</CODE> values of its
adjustment.
<P>You probably won't ever need to attach a handler to this signal,
unless you're writing a new type of range widget.  However, if you
change any of the values in a Adjustment directly, you should emit
this signal on it to reconfigure whatever widgets are using it, like
this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
gtk_signal_emit_by_name (GTK_OBJECT (adjustment), "changed");
</PRE>
</CODE></BLOCKQUOTE>
<P>Now go forth and adjust!
<HR>
<A HREF="gtk_tut-8.html">Next</A>
<A HREF="gtk_tut-6.html">Previous</A>
<A HREF="gtk_tut.html#toc7">Contents</A>
</BODY>
</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲愉拍自拍另类高清精品| 亚洲欧美在线另类| 国产成人精品三级麻豆| 午夜电影网一区| 一区二区三区在线不卡| 亚洲视频在线观看三级| 综合婷婷亚洲小说| 精品一区二区在线观看| 久久国产尿小便嘘嘘尿| 精品影院一区二区久久久| 日本二三区不卡| 色婷婷av一区二区三区大白胸| 波多野结衣一区二区三区| 国产福利91精品| 欧美一区二区三区啪啪| 3751色影院一区二区三区| 91精选在线观看| 一区二区三区中文字幕精品精品| 国产精品一区不卡| 99久久99久久综合| 精品视频一区三区九区| 91精品国产综合久久蜜臀| 一区二区三区欧美视频| 99免费精品在线| 久久尤物电影视频在线观看| 国产三级欧美三级日产三级99 | 精品视频1区2区| 国产精品进线69影院| 一区二区三区在线视频免费| 成人综合在线网站| 日韩精品一区二区三区在线播放| 久久综合色综合88| 久久99久久久久| 欧美精品一区二区三区蜜桃视频| 一区视频在线播放| www.欧美色图| 一区二区三区四区中文字幕| 欧美在线视频你懂得| 国产亚洲短视频| 国产精品综合在线视频| 国产精品久久久久久亚洲毛片| 国产盗摄一区二区| 亚洲国产精品传媒在线观看| 亚洲国产日韩a在线播放性色| 国产一区二区在线电影| 91久久精品日日躁夜夜躁欧美| 曰韩精品一区二区| 粉嫩绯色av一区二区在线观看| 欧美精品国产精品| 一区二区三区欧美久久| 欧美日韩综合色| 日韩va亚洲va欧美va久久| 成人福利电影精品一区二区在线观看| 日韩亚洲欧美在线观看| 亚洲夂夂婷婷色拍ww47| 欧美另类videos死尸| 久久不见久久见免费视频7| 国产婷婷色一区二区三区四区 | 一区二区视频在线| 91精品国产综合久久精品性色| 久久国产精品99精品国产| 欧美国产一区二区| 欧美色爱综合网| 国产一二精品视频| 亚洲欧洲av另类| 日韩一区和二区| 不卡的电视剧免费网站有什么| 亚洲精选一二三| 久久奇米777| 麻豆成人免费电影| 91精品国产麻豆| www.日韩av| 免费成人小视频| 日韩免费成人网| 97精品国产露脸对白| 精品制服美女丁香| 夜夜操天天操亚洲| 久久久国产综合精品女国产盗摄| 色婷婷av一区二区| 国产精品白丝av| 日韩国产欧美在线视频| 亚洲欧洲无码一区二区三区| 欧美一区二区三区视频免费播放 | 亚洲精品欧美专区| 久久婷婷综合激情| 欧美日韩国产成人在线91| 视频一区二区中文字幕| 91精品国产一区二区| 99精品视频一区二区三区| 久久精品国产**网站演员| 亚洲精品国产无天堂网2021| 久久九九国产精品| 精品国产在天天线2019| 欧美日韩另类国产亚洲欧美一级| 成人综合在线观看| 国产成人在线网站| 国内外成人在线| 国产精品欧美经典| 色一情一乱一乱一91av| 国产丶欧美丶日本不卡视频| 麻豆成人综合网| 秋霞av亚洲一区二区三| 亚洲一区二区三区美女| 亚洲美女视频在线观看| 91精品国产福利在线观看| 色婷婷久久综合| 99国产麻豆精品| 成人动漫一区二区三区| 国产91精品久久久久久久网曝门| 久久精品久久久精品美女| 日本中文字幕一区二区有限公司| 亚洲综合成人在线| 一区二区在线免费| 亚洲小说欧美激情另类| 一区二区成人在线视频| 日韩高清不卡一区| 首页亚洲欧美制服丝腿| 亚洲.国产.中文慕字在线| 国产三级一区二区| 国产拍揄自揄精品视频麻豆| 久久精品综合网| 国产精品久久久久久久久果冻传媒 | 国产精品综合一区二区三区| 国产一区二区三区蝌蚪| 成人黄色大片在线观看| av欧美精品.com| 欧洲色大大久久| 7777精品伊人久久久大香线蕉完整版 | 免费视频最近日韩| 裸体歌舞表演一区二区| 久草这里只有精品视频| 国产酒店精品激情| 91麻豆免费观看| 久久黄色级2电影| 国产精品乡下勾搭老头1| 成人性生交大片免费看视频在线 | 91精品国产综合久久国产大片| 精品国产伦一区二区三区观看方式 | 亚洲精品一区二区精华| 国产三级一区二区| 亚洲一区免费在线观看| 麻豆精品国产传媒mv男同| 国产伦精品一区二区三区在线观看 | 欧美久久久久久久久久| 欧美一区二区三区思思人| 国产欧美一区二区精品忘忧草| 成人欧美一区二区三区视频网页 | 国产麻豆精品视频| 91在线高清观看| 3d成人h动漫网站入口| 国产三级精品三级在线专区| 亚洲国产aⅴ成人精品无吗| 九一九一国产精品| 91久久香蕉国产日韩欧美9色| 欧美一区二区三区视频在线观看| 欧美国产日韩亚洲一区| 图片区小说区区亚洲影院| 国产aⅴ综合色| 日韩一区国产二区欧美三区| 亚洲视频1区2区| 激情综合网av| 欧美日韩一级二级| 国产精品嫩草久久久久| 日日夜夜免费精品| 99re亚洲国产精品| 久久在线观看免费| 免费成人在线播放| 欧美午夜寂寞影院| 色婷婷精品大视频在线蜜桃视频 | 欧美日韩第一区日日骚| 国产精品丝袜在线| 黄页网站大全一区二区| 欧美日韩国产高清一区| 亚洲桃色在线一区| 国产麻豆精品一区二区| 日韩亚洲电影在线| 亚洲午夜激情av| 色老汉av一区二区三区| 日本一二三不卡| 激情偷乱视频一区二区三区| 精品视频一区二区不卡| 亚洲欧洲成人精品av97| 国产1区2区3区精品美女| 欧美成人aa大片| 国产精品毛片a∨一区二区三区| 麻豆精品视频在线观看视频| 欧美老年两性高潮| 亚洲成av人综合在线观看| 一道本成人在线| 亚洲人成网站在线| 白白色亚洲国产精品| 国产精品视频一区二区三区不卡| 国内外成人在线视频| 久久尤物电影视频在线观看| 久久国产婷婷国产香蕉| 精品国产凹凸成av人网站| 久久99日本精品| 国产视频一区在线播放| 懂色av一区二区三区蜜臀| 欧美经典一区二区|