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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gtk_tut-8.html

?? GTK development guide
?? HTML
?? 第 1 頁 / 共 2 頁
字號(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: Range Widgets</TITLE>
 <LINK HREF="gtk_tut-9.html" REL=next>
 <LINK HREF="gtk_tut-7.html" REL=previous>
 <LINK HREF="gtk_tut.html#toc8" REL=contents>
</HEAD>
<BODY TEXT="#CCCCCC" BGCOLOR="#000000" LINK="#33cc00" VLINK="#009900" ALINK="#FF0000">
<A HREF="gtk_tut-9.html">Next</A>
<A HREF="gtk_tut-7.html">Previous</A>
<A HREF="gtk_tut.html#toc8">Contents</A>
<HR>
<H2><A NAME="sec_Range_Widgets"></A> <A NAME="s8">8. Range Widgets</A></H2>

<P>The category of range widgets includes the ubiquitous scrollbar widget
and the less common "scale" widget. Though these two types of widgets
are generally used for different purposes, they are quite similar in
function and implementation. All range widgets share a set of common
graphic elements, each of which has its own X window and receives
events. They all contain a "trough" and a "slider" (what is sometimes
called a "thumbwheel" in other GUI environments). Dragging the slider
with the pointer moves it back and forth within the trough, while
clicking in the trough advances the slider towards the location of the
click, either completely, or by a designated amount, depending on
which mouse button is used.
<P>As mentioned in 
<A HREF="gtk_tut-7.html#sec_Adjustment">Adjustments</A> above,
all range widgets are associated with an adjustment object, from which
they calculate the length of the slider and its position within the
trough. When the user manipulates the slider, the range widget will
change the value of the adjustment.
<P>
<H2><A NAME="ss8.1">8.1 Scrollbar Widgets</A>
</H2>

<P>These are your standard, run-of-the-mill scrollbars. These should be
used only for scrolling some other widget, such as a list, a text box,
or a viewport (and it's generally easier to use the scrolled window
widget in most cases).  For other purposes, you should use scale
widgets, as they are friendlier and more featureful.
<P>There are separate types for horizontal and vertical scrollbars.
There really isn't much to say about these. You create them with the
following functions, defined in <CODE>&lt;gtk/gtkhscrollbar.h&gt;</CODE>
and <CODE>&lt;gtk/gtkvscrollbar.h&gt;</CODE>:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_hscrollbar_new( GtkAdjustment *adjustment );

GtkWidget *gtk_vscrollbar_new( GtkAdjustment *adjustment );
</PRE>
</CODE></BLOCKQUOTE>
<P>and that's about it (if you don't believe me, look in the header
files!).  The <CODE>adjustment</CODE> argument can either be a pointer to an
existing Adjustment, or NULL, in which case one will be created for
you. Specifying NULL might actually be useful in this case, if you
wish to pass the newly-created adjustment to the constructor function
of some other widget which will configure it for you, such as a text
widget.
<H2><A NAME="ss8.2">8.2 Scale Widgets</A>
</H2>

<P>Scale widgets are used to allow the user to visually select and
manipulate a value within a specific range. You might want to use a
scale widget, for example, to adjust the magnification level on a
zoomed preview of a picture, or to control the brightness of a color,
or to specify the number of minutes of inactivity before a screensaver
takes over the screen.
<P>
<H3>Creating a Scale Widget</H3>

<P>As with scrollbars, there are separate widget types for horizontal and
vertical scale widgets. (Most programmers seem to favour horizontal
scale widgets.) Since they work essentially the same way, there's no
need to treat them separately here. The following functions, defined
in <CODE>&lt;gtk/gtkvscale.h&gt;</CODE> and
<CODE>&lt;gtk/gtkhscale.h&gt;</CODE>, create vertical and horizontal scale
widgets, respectively:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkWidget *gtk_vscale_new( GtkAdjustment *adjustment );

GtkWidget *gtk_hscale_new( GtkAdjustment *adjustment );
</PRE>
</CODE></BLOCKQUOTE>
<P>The <CODE>adjustment</CODE> argument can either be an adjustment which has
already been created with <CODE>gtk_adjustment_new()</CODE>, or <CODE>NULL</CODE>, in
which case, an anonymous Adjustment is created with all of its
values set to <CODE>0.0</CODE> (which isn't very useful in this case). In
order to avoid confusing yourself, you probably want to create your
adjustment with a <CODE>page_size</CODE> of <CODE>0.0</CODE> so that its <CODE>upper</CODE>
value actually corresponds to the highest value the user can select.
(If you're <EM>already</EM> thoroughly confused, read the section on 
<A HREF="gtk_tut-7.html#sec_Adjustment">Adjustments</A> again for an explanation of
what exactly adjustments do and how to create and manipulate them.)
<P>
<H3>Functions and Signals (well, functions, at least)</H3>

<P>Scale widgets can display their current value as a number beside the
trough. The default behaviour is to show the value, but you can change
this with this function:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_scale_set_draw_value( GtkScale *scale,
                               gint      draw_value );
</PRE>
</CODE></BLOCKQUOTE>
<P>As you might have guessed, <CODE>draw_value</CODE> is either <CODE>TRUE</CODE> or
<CODE>FALSE</CODE>, with predictable consequences for either one.
<P>The value displayed by a scale widget is rounded to one decimal point
by default, as is the <CODE>value</CODE> field in its GtkAdjustment. You can
change this with:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_scale_set_digits( GtkScale *scale,
                            gint     digits );
</PRE>
</CODE></BLOCKQUOTE>
<P>where <CODE>digits</CODE> is the number of decimal places you want. You can
set <CODE>digits</CODE> to anything you like, but no more than 13 decimal
places will actually be drawn on screen.
<P>Finally, the value can be drawn in different positions
relative to the trough:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_scale_set_value_pos( GtkScale        *scale,
                              GtkPositionType  pos );
</PRE>
</CODE></BLOCKQUOTE>
<P>The argument <CODE>pos</CODE> is of type <CODE>GtkPositionType</CODE>, which is
defined in <CODE>&lt;gtk/gtkenums.h&gt;</CODE>, and can take one of the
following values:
<P>
<BLOCKQUOTE><CODE>
<PRE>
  GTK_POS_LEFT
  GTK_POS_RIGHT
  GTK_POS_TOP
  GTK_POS_BOTTOM
</PRE>
</CODE></BLOCKQUOTE>
<P>If you position the value on the "side" of the trough (e.g., on the
top or bottom of a horizontal scale widget), then it will follow the
slider up and down the trough.
<P>All the preceding functions are defined in
<CODE>&lt;gtk/gtkscale.h&gt;</CODE>. The header files for all GTK widgets
are automatically included when you include
<CODE>&lt;gtk/gtk.h&gt;</CODE>. But you should look over the header files
of all widgets that interest you,
<P>
<H2><A NAME="sec_Range_Functions"></A> <A NAME="ss8.3">8.3 Common Range Functions </A>
</H2>

<P>The Range widget class is fairly complicated internally, but, like
all the "base class" widgets, most of its complexity is only
interesting if you want to hack on it. Also, almost all of the
functions and signals it defines are only really used in writing
derived widgets. There are, however, a few useful functions that are
defined in <CODE>&lt;gtk/gtkrange.h&gt;</CODE> and will work on all range
widgets.
<P>
<H3>Setting the Update Policy</H3>

<P>The "update policy" of a range widget defines at what points during
user interaction it will change the <CODE>value</CODE> field of its
Adjustment and emit the "value_changed" signal on this
Adjustment. The update policies, defined in
<CODE>&lt;gtk/gtkenums.h&gt;</CODE> as type <CODE>enum GtkUpdateType</CODE>,
are:
<P>
<UL>
<LI>GTK_UPDATE_POLICY_CONTINUOUS - This is the default. The
"value_changed" signal is emitted continuously, i.e., whenever the
slider is moved by even the tiniest amount.</LI>
<LI>GTK_UPDATE_POLICY_DISCONTINUOUS - The "value_changed" signal is
only emitted once the slider has stopped moving and the user has
released the mouse button.</LI>
<LI>GTK_UPDATE_POLICY_DELAYED - The "value_changed" signal is emitted
when the user releases the mouse button, or if the slider stops moving
for a short period of time.</LI>
</UL>
<P>The update policy of a range widget can be set by casting it using the
<CODE>GTK_RANGE (Widget)</CODE> macro and passing it to this function:
<P>
<BLOCKQUOTE><CODE>
<PRE>
void gtk_range_set_update_policy( GtkRange      *range,
                                  GtkUpdateType  policy) ;
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H3>Getting and Setting Adjustments</H3>

<P>Getting and setting the adjustment for a range widget "on the fly" is
done, predictably, with:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GtkAdjustment* gtk_range_get_adjustment( GtkRange *range );

void gtk_range_set_adjustment( GtkRange      *range,
                               GtkAdjustment *adjustment );
</PRE>
</CODE></BLOCKQUOTE>
<P><CODE>gtk_range_get_adjustment()</CODE> returns a pointer to the adjustment to
which <CODE>range</CODE> is connected.
<P><CODE>gtk_range_set_adjustment()</CODE> does absolutely nothing if you pass it
the adjustment that <CODE>range</CODE> is already using, regardless of whether
you changed any of its fields or not. If you pass it a new
Adjustment, it will unreference the old one if it exists (possibly
destroying it), connect the appropriate signals to the new one, and
call the private function <CODE>gtk_range_adjustment_changed()</CODE>, which
will (or at least, is supposed to...) recalculate the size and/or
position of the slider and redraw if necessary. As mentioned in the
section on adjustments, if you wish to reuse the same Adjustment,
when you modify its values directly, you should emit the "changed"
signal on it, like this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
gtk_signal_emit_by_name (GTK_OBJECT (adjustment), "changed");
</PRE>
</CODE></BLOCKQUOTE>
<H2><A NAME="ss8.4">8.4 Key and Mouse bindings</A>
</H2>

<P>All of the GTK range widgets react to mouse clicks in more or less
the same way. Clicking button-1 in the trough will cause its
adjustment's <CODE>page_increment</CODE> to be added or subtracted from its
<CODE>value</CODE>, and the slider to be moved accordingly. Clicking mouse
button-2 in the trough will jump the slider to the point at which the
button was clicked. Clicking any button on a scrollbar's arrows will
cause its adjustment's value to change <CODE>step_increment</CODE> at a time.
<P>It may take a little while to get used to, but by default, scrollbars
as well as scale widgets can take the keyboard focus in GTK. If you
think your users will find this too confusing, you can always disable
this by unsetting the <CODE>GTK_CAN_FOCUS</CODE> flag on the scrollbar, like
this:
<P>
<BLOCKQUOTE><CODE>
<PRE>
GTK_WIDGET_UNSET_FLAGS (scrollbar, GTK_CAN_FOCUS);
</PRE>
</CODE></BLOCKQUOTE>
<P>The key bindings (which are, of course, only active when the widget
has focus) are slightly different between horizontal and vertical
range widgets, for obvious reasons. They are also not quite the same
for scale widgets as they are for scrollbars, for somewhat less
obvious reasons (possibly to avoid confusion between the keys for
horizontal and vertical scrollbars in scrolled windows, where both
operate on the same area).
<P>
<H3>Vertical Range Widgets</H3>

<P>All vertical range widgets can be operated with the up and down arrow
keys, as well as with the <CODE>Page Up</CODE> and <CODE>Page Down</CODE> keys. The
arrows move the slider up and down by <CODE>step_increment</CODE>, while
<CODE>Page Up</CODE> and <CODE>Page Down</CODE> move it by <CODE>page_increment</CODE>.
<P>The user can also move the slider all the way to one end or the other
of the trough using the keyboard. With the VScale widget, this is
done with the <CODE>Home</CODE> and <CODE>End</CODE> keys, whereas with the
VScrollbar widget, this is done by typing <CODE>Control-Page Up</CODE>
and <CODE>Control-Page Down</CODE>.
<P>
<H3>Horizontal Range Widgets</H3>

<P>The left and right arrow keys work as you might expect in these
widgets, moving the slider back and forth by <CODE>step_increment</CODE>. The
<CODE>Home</CODE> and <CODE>End</CODE> keys move the slider to the ends of the trough.
For the HScale widget, moving the slider by <CODE>page_increment</CODE> is
accomplished with <CODE>Control-Left</CODE> and <CODE>Control-Right</CODE>,
while for HScrollbar, it's done with <CODE>Control-Home</CODE> and
<CODE>Control-End</CODE>.
<H2><A NAME="sec_Range_Example"></A> <A NAME="ss8.5">8.5 Example</A>
</H2>

<P>This example is a somewhat modified version of the "range controls"
test from <CODE>testgtk.c</CODE>. It basically puts up a window with three
range widgets all connected to the same adjustment, and a couple of
controls for adjusting some of the parameters mentioned above and in
the section on adjustments, so you can see how they affect the way
these widgets work for the user.
<P>
<BLOCKQUOTE><CODE>
<PRE>
/* example-start rangewidgets rangewidgets.c */

#include &lt;gtk/gtk.h>

GtkWidget *hscale, *vscale;

void cb_pos_menu_select( GtkWidget       *item,
                         GtkPositionType  pos )

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
三级欧美韩日大片在线看| 久久色中文字幕| 亚洲国产美女搞黄色| 色综合久久久久| 亚洲国产你懂的| 欧美一区午夜视频在线观看| 经典一区二区三区| 日本一区二区视频在线观看| 成人小视频在线| 亚洲国产欧美在线| 日韩精品一区在线| 成人sese在线| 午夜欧美一区二区三区在线播放| 日本高清视频一区二区| 亚洲成av人片在www色猫咪| 欧美丰满一区二区免费视频| 国产在线精品一区二区不卡了| 久久夜色精品国产噜噜av| 91麻豆精品国产91久久久资源速度| 午夜不卡av免费| 欧美精品一区男女天堂| 成人av小说网| 日本欧美一区二区| 欧美高清一级片在线观看| 91久久精品一区二区二区| 日韩电影在线看| 国产精品免费看片| 欧美一区二区三区四区高清| 国产精品中文字幕一区二区三区| 一区二区三区中文免费| 日韩欧美在线不卡| 91在线精品一区二区三区| 视频一区二区三区中文字幕| 国产日韩三级在线| 69久久99精品久久久久婷婷| 国产成人在线免费观看| 亚洲电影在线播放| 欧美激情一区在线观看| 88在线观看91蜜桃国自产| 成人深夜视频在线观看| 青青草成人在线观看| 中文字幕中文字幕一区| 337p粉嫩大胆色噜噜噜噜亚洲 | 亚洲一区二区3| 久久精品视频免费观看| 欧美日韩亚州综合| 95精品视频在线| 国产伦精品一区二区三区视频青涩| 亚洲欧美一区二区久久| 2021中文字幕一区亚洲| 欧美日韩黄视频| 成人国产精品视频| 国产一区久久久| 麻豆成人免费电影| 亚洲午夜一区二区三区| 亚洲欧洲日韩在线| 国产女同互慰高潮91漫画| 欧美不卡一区二区三区四区| 欧美日精品一区视频| 91丨porny丨国产| 成人免费高清在线观看| 久久99久久精品| 秋霞午夜av一区二区三区| 午夜视频一区二区| 亚洲国产美国国产综合一区二区| 亚洲人成在线播放网站岛国| 中文无字幕一区二区三区| 久久影音资源网| 久久精品网站免费观看| 欧美成人精品二区三区99精品| 欧美性受xxxx黑人xyx性爽| 一本到不卡免费一区二区| heyzo一本久久综合| av网站免费线看精品| 欧美福利视频导航| 91精品啪在线观看国产60岁| 欧美日韩一区二区三区四区五区 | 精品av久久707| 日韩免费性生活视频播放| 精品视频在线视频| 欧美卡1卡2卡| 日韩欧美中文字幕精品| 日韩一区二区不卡| 精品国产麻豆免费人成网站| 精品国免费一区二区三区| 精品久久久久久综合日本欧美 | 东方aⅴ免费观看久久av| 狠狠网亚洲精品| 国产美女av一区二区三区| 国产呦精品一区二区三区网站| 国产乱人伦偷精品视频免下载| 国产黄色精品网站| 东方欧美亚洲色图在线| 91亚洲男人天堂| 欧美日韩国产乱码电影| 日韩欧美亚洲国产另类| 国产日韩综合av| 亚洲精品国产一区二区三区四区在线| 亚洲精品高清视频在线观看| 天天色 色综合| 九九国产精品视频| 成人免费毛片嘿嘿连载视频| 91黄色免费版| 日韩欧美国产系列| 国产亲近乱来精品视频| 亚洲精品综合在线| 理论片日本一区| www.亚洲免费av| 欧美日韩精品三区| 国产日韩欧美精品一区| 一级精品视频在线观看宜春院| 日韩国产在线观看| 国产成人在线影院| 欧美色图一区二区三区| 精品久久久久一区| 一区二区三区中文在线| 国产一区二区三区免费播放| 在线亚洲人成电影网站色www| 日韩一区二区三区视频在线| 日本一区二区电影| 丝瓜av网站精品一区二区| 国产精品一二三四区| 欧美性感一类影片在线播放| www成人在线观看| 亚洲一区二区av在线| 国产精品77777| 91麻豆精品国产91久久久| 国产精品国产三级国产有无不卡 | 日韩精品色哟哟| 成人一区二区三区| 91麻豆精品91久久久久同性| 亚洲视频综合在线| 激情综合网av| 欧美日韩精品三区| 亚洲女同一区二区| 国产精品资源网| 精品久久久网站| 丝袜亚洲另类欧美综合| 精品日韩一区二区三区免费视频| 最新热久久免费视频| 寂寞少妇一区二区三区| 91精品国产一区二区三区香蕉 | 国产精品欧美一级免费| 久久99国产精品成人| 欧美三级欧美一级| 亚洲视频1区2区| 成人精品视频.| 久久久久99精品一区| 蜜桃av噜噜一区| 欧美一级欧美一级在线播放| 一区二区欧美国产| 99re成人在线| 国产精品第四页| 成人av先锋影音| 日韩一区日韩二区| 成人av网站大全| 中文字幕成人av| 成人理论电影网| 国产欧美一区二区精品久导航 | 亚洲国产高清在线观看视频| 蜜臀av性久久久久蜜臀av麻豆| 欧洲av一区二区嗯嗯嗯啊| 国产精品久久久久影院色老大| 国产一区999| 国产日产欧美一区二区三区| 国产麻豆精品视频| 精品久久国产老人久久综合| 免费欧美日韩国产三级电影| 欧美日本乱大交xxxxx| 亚洲一区二区四区蜜桃| 欧美群妇大交群中文字幕| 日韩精品一二三四| 精品捆绑美女sm三区| 激情av综合网| 亚洲国产精品ⅴa在线观看| 成人精品电影在线观看| 亚洲欧美偷拍卡通变态| 日本道色综合久久| 亚洲高清免费观看| 欧美一区二区三区男人的天堂| 免费日本视频一区| 精品国产一区久久| 国产成人精品亚洲日本在线桃色| 中文字幕第一区第二区| 一本久道中文字幕精品亚洲嫩| 亚洲一区二区精品3399| 欧美伦理影视网| 国产一区二区三区av电影| 国产区在线观看成人精品| 成人ar影院免费观看视频| 亚洲香蕉伊在人在线观| 日韩一区二区精品葵司在线| 国产专区欧美精品| 国产精品久久久久久久久免费樱桃| 99精品视频在线观看免费| 亚洲国产视频网站| 久久麻豆一区二区| 91久久精品一区二区三区| 奇米精品一区二区三区四区| 国产午夜精品久久久久久久|