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

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

?? unx47.htm

?? Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
XtWarning("Widget does not keep a copy! Do NOT free original");

XtWarning(" Checking GetValues");

if (x1 == x2)

     XtWarning("Widget returns a copy! Do NOT free");

else

XtWarning(&quot;Widget does not return a copy! You should free it &quot;);</PRE>

<P>The XtWarning() message is especially useful for debugging the execution of programs. The message is relayed to the stderr of the invoking application. If this is an xterm, you will see an error message on that terminal window. If no stderr is available 

for the invoker, the message is lost.

<BR></P>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP:</B> The XtSetArg macro is defined as:

<BR>

<BR>#define XtSetArg(arg,n,d) \

<BR>    ((void)((arg).name = (n).(arg).value = (XtArgVal)))

<BR>

<BR>Do not use XtSetArg(arg[n++], ... because this will increment n twice.

<BR></NOTE>

<HR ALIGN=CENTER>

<H3 ALIGN="CENTER">

<CENTER><A ID="I13" NAME="I13">

<FONT SIZE=4><B>The PushButton Widget</B>

<BR></FONT></A></CENTER></H3>

<P>XmPushButton is perhaps the most heavily used widget in Motif.

<BR></P>

<P>Listings 1 and 2 showed the basic usage for this class. When a button is pressed in the pushbutton area, the button goes into an &quot;armed&quot; state. The color of the button changes to reflect this state. This color can be set by using XmNarmColor. 

This color is shown when the XmNfillOnArm resource is set to TRUE.

<BR></P>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP:</B> If the XmNarmcolor for a pushbutton does not seem to be working, try setting the XmNfillOnArm resource to TRUE.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>The callback functions for a pushbutton are:

<BR></P>

<UL>

<LI>XmNarmCallback: Called when a pushbutton is armed.

<BR>

<BR></LI>

<LI>XmNactivateCallback: Called when a button is released in the widgets area while the widget is armed. This is not invoked if the pointer is outside the widget when the button is released.

<BR>

<BR></LI>

<LI>XmNdisarmCallback: Called when a button is released with the pointer outside the widget area while the widget is armed.

<BR>

<BR></LI></UL>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP:</B> If a callback has more than one function registered for a widget, all the functions will be called but not necessarily in the order they were registered. Do not rely on the same order being preserved on 

other systems. If you want more than one function performed during a callback, sandwich them in one function call.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>In Listing 47.2, you saw how a callback function was added to a pushbutton with the XtAddCallback function. The same method can be used to call other functions for other actions, such as the XmNdisarmCallback.

<BR></P>

<H4 ALIGN="CENTER">

<CENTER><A ID="I14" NAME="I14">

<FONT SIZE=3><B>The Toggle Button Widget</B>

<BR></FONT></A></CENTER></H4>

<P>The toggle button class is a subclass of the XmLabel widget class. There are two types of buttons: N of many and one of many. When using N of many, users can select many options. When using one of many, the users must make one selection from many items. 

Note the way the buttons are drawn; N of many buttons are shown as boxes and one of many buttons are shown as diamonds.

<BR></P>

<P>The resources for this widget include:

<BR></P>

<UL>

<LI>XmNindicatorType: This determines the style and can be set to XmN_OF_MANY or XmONE_OF_MANY (the default).

<BR>

<BR></LI>

<LI>XmNspacing: The number of pixels between the button and its label.

<BR>

<BR></LI>

<LI>XmNfillOnSelect: The color of the button changes to reflect a &quot;set&quot; when the XmNfillOnArm resource is set to TRUE.

<BR>

<BR></LI>

<LI>XmNfillColor: The color to show when &quot;set.&quot;

<BR>

<BR></LI>

<LI>XmNset: A Boolean resource indicating whether the button is set or not. If this resource is set from a program, the button will automatically reflect the change.

<BR>

<BR></LI></UL>

<P>It's easier to use the convenience function XmToggleButtonGetState(Widget w) to get the Boolean state for a widget, and to use XmToggleButtonSetState(Widget w, Boolean b) to set the value for a toggle button widget.

<BR></P>

<P>Like the pushbutton class, the toggle button class has three similar callbacks:

<BR></P>

<UL>

<LI>XmNarmCallback: Called when the toggle button is armed.

<BR>

<BR></LI>

<LI>XmNvalueChangedCallback: Called when a button is released in the widget area while the widget is armed. This is not invoked if the pointer is outside the widget when the button is released.

<BR>

<BR></LI>

<LI>XmNdisarmCallback: Called when a button is released with the pointer outside the widget area while the widget is armed.

<BR>

<BR></LI></UL>

<P>For the callbacks, the callback data is a structure of type:

<BR></P>

<PRE>typedef struct {

     int  reason;

     XEvent  *event;

     int  set;

} XmToggleButtonCallbackStruct;</PRE>

<P>The reason for the callback is one of the following: XmCR_ARM, XmCR_DISARM, or XmCR_ACTIVATE. The event is a pointer to XEvent that caused this callback. The set value is 0 if the item is not set and non-zero if it's set. The buttons are arranged in one 

column through the RowColumn widget discussed later in this chapter. See file 47_3c on the CD-ROM for an example of how to use the toggle button.

<BR></P>

<P>By defining the DO_RADIO label, you can make this into a radio button application. That is, only one of the buttons can be selected at one time.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I15" NAME="I15">

<FONT SIZE=4><B>Convenience Functions</B>

<BR></FONT></A></CENTER></H3>

<P>Usually, the way to set resources for a widget is to do it when you create the widget. This is done with either the XtVaCreateManaged call or the XmCreateYYY call, where YYY is the widget you're creating. The text uses the variable argument call to 
create and manage widgets. If you use the XmCreateYYY call, you have to set the resource settings in a list of resource sets. An example of creating a Label widget is shown in file 47_4c on the CD-ROM. This is a function that creates a Label widget on a 
widget given the string x.

<BR></P>

<P>Or you could use the variable argument lists to create this label, as shown in file 47_5c.

<BR></P>

<P>In either case, it's your judgment call as to which one to use. The label created with the variable lists is a bit easier to read and maintain. But what about setting values after a widget has been created? This would be done through a call to 
XtSetValue with a list and count of resource settings. For example, to change the alignment and text of a label, you would use the following:

<BR></P>

<PRE>n = 0;

XtSetArg(arg[n], XmNalignment, XmALIGNMENT_BEGIN); n++;

XtSetArg(arg[n], XmNlabelString, x); n++;

XtSetValues(lbl,arg,n);</PRE>

<P>Similarly, to get the values for a widget you would use XtGetValues:

<BR></P>

<PRE>Cardinal n; /* usually an integer or short... use Cardinal to be safe

*/ int align;

XmString x;

...

n = 0;

XtSetArg(arg[n], XmNalignment, &amp;align); n++;

XtSetArg(arg[n], XmNlabelString, &amp;x); n++; XtGetValues(lbl,arg,n);</PRE>

<P>In the case of other widgets, such as the Text widget, this setting scheme is hard to read, quite clumsy, and prone to typos. For example, to get a string for a Text widget, do you use x or address of x?

<BR></P>

<P>For this reason, Motif provides convenience functions. In the ToggleButton widget class, for example, rather than use the combination of XtSetValue and XtSetArg calls to get the state, you would use one call, XmToggleButtonGetState(Widget w), to get the 

state. These functions are valuable code savers when you're writing complex applications. In fact, you should write similar convenience functions whenever you cannot find one that suits your needs.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I16" NAME="I16">

<FONT SIZE=4><B>The List Widget</B>

<BR></FONT></A></CENTER></H3>

<P>The List widget displays a list of items from which the user can select. The list is created from a list of compound strings. Users can select either one item or many items from this list. The resources for this widget include:

<BR></P>

<UL>

<LI>XmNitemCount: This determines the number of items in the list.

<BR>

<BR></LI>

<LI>XmNitems: An array of compound strings. Each entry corresponds to an item in the list. Note that a List widget makes a copy of all items in its list when using XtSetValues; however, it returns a pointer to its internal structure when returning values 
to an XtGetValues call. So do not free this pointer from XtGetValues.

<BR>

<BR></LI>

<LI>XmNselectedItemCount: The number of items currently selected.

<BR>

<BR></LI>

<LI>XmNselectedItems: The list of selected items.

<BR>

<BR></LI>

<LI>XmNvisibleItemCount: The number of items to display at one time.

<BR>

<BR></LI>

<LI>XmNselectionPolicy: This is used to set single or multiple selection capability. If set to XmSINGLE_SELECT, the user will be able to select only one item. Each selection will invoke XmNsingleSelectionCallback. Selecting one item will deselect another 
previously selected item. If set to XmEXTENDED_SELECT, the user will be able to select a block of contiguous items in a list. Selecting one or more new items will deselect other previously selected items. Each selection will invoke the XmNmultipleSelection 

callback.

<BR>

<BR></LI></UL>

<P>If set to XmMULTIPLE_SELECT, the user will be able to select multiple items in any order. Selecting one item will not deselect another previously selected item. Each selection will invoke the XmNmultipleSelection callback.

<BR></P>

<P>If the resource is set to XmBROWSE_SELECT, the user can move the pointer across all the selections with the button pressed, but only one item will be selected. This will invoke XmbrowseSelectionCallback when the button is finally released on the last 
item browsed. Unlike with the XmSINGLE_SELECT setting, the user does not have to press and release the button to select an item.

<BR></P>

<P>It is easier to create the List widget with a call to XmCreateScrolledList(), because this will automatically create a scrolled window for you. Also, the following convenience functions will make working with List widgets easier. However, they may prove 

to be slow when compared to XtSetValues() calls. If you feel that speed is important, consider using XtSetValues(). You should create the list for the first time by using XtSetValues.

<BR></P>

<UL>

<LI>XmListAddItem(Widget w, XmString x, int pos): This will add the compound string x to the List widget w at the 1-relative position pos. If pos is 0, the item is added to the back of the list. This function is very slow. Do not use it to create a new 
list, because it rearranges the entire list before returning.

<BR>

<BR></LI>

<LI>XmListAddItems(Widget w, XmString *x, int count, int pos): This will add the array of compound strings, x, of size count, to the List widget w from the position pos. If pos is 0, the item is added to the back of the list. This function is slow too, so 

do not use it to create a new list.

<BR>

<BR></LI>

<LI>XmDeleteAllItems(Widget w): This will delete all the items in a list. It's better to write a convenience function:

<BR>

<BR>n = 0; 

<BR>XtSetArg(arg[n], XmNitems, NULL); n++;

<BR>XtSetArg(arg[n], XmNitemCount, 0); n++;

<BR>XtSetValues(mylist,arg,n);

<BR></LI>

<LI>XmDeleteItem(Widget w, XmString x): Deletes the item x from the list. This is a slow function.

<BR>

<BR></LI>

<LI>XmDeleteItems(Widget w, XmString *x, int count): Deletes all the count items in x from the list. This is an even slower function. You might be better off installing a new list.

<BR>

<BR></LI>

<LI>XmListSelectItem(Widget w, XmString x, Boolean Notify): Programmatically selects x in the list. If Notify is TRUE, the appropriate callback function is also invoked.

<BR>

<BR></LI>

<LI>XmListDeselectItem(Widget w, XmString x): Programmatically deselects x in the list.

<BR>

<BR></LI>

<LI>XmListPos( Widget w, XmString x): Returns the position of x in the list. 0 if not found.

<BR>

<BR></LI></UL>

<P>See file 47_6c on the CD-ROM.

<BR></P>

<H3 ALIGN="CENTER">

<CENTER><A ID="I17" NAME="I17">

<FONT SIZE=4><B>The Scrollbar Widget</B>

<BR></FONT></A></CENTER></H3>

<P>The Scrollbar widget allows the user to select a value from a range. Its resources include:

<BR></P>

<UL>

<LI>XmNvalue: The value representing the location of the slider.

<BR>

<BR></LI>

<LI>XmNminimum and XmNmaximum: The range of values for the slider.

<BR>

<BR></LI>

<LI>XmNshowArrows: The Boolean value if set shows arrows at either end.

<BR>

<BR></LI>

<LI>XmNorientation: Set to XmHORIZONTAL for a horizontal bar or XmVERTICAL (default) for a vertical bar.

<BR>

<BR></LI>

<LI>XmNprocessingDirection: Set to either XmMAX_ON_LEFT or XmMAX_ON_RIGHT for XmHORIZONTAL, or XmMAX_ON_TOP or XmMAX_ON_BOTTOM for XmVERTICAL orientation.

<BR>

<BR></LI>

<LI>XmNincrement: The increment per move.

<BR>

<BR></LI>

<LI>XmNpageIncrement: The increment if a button is pressed in the arrows or the box. This is defaulted to 10.

<BR>

<BR></LI>

<LI>XmNdecimalPoint: Shows the decimal point from the right. Note that all values in the Scrollbar widget's values are given as integers. Look at the radio station selection example in file 47_8c on the CD-ROM. Note that the Push to Exit button for the 
application is offset on the left and right by 20 pixels. This is done by offsetting the XmATTACH_FORM value for each side (left or right) through the value in XmNleftOffset and XmNrightOffset. See the &quot;Forms&quot; section for more details.

<BR>

<BR></LI></UL>

<P>For the case of FM selections, you would want the bar to show odd numbers. A good exercise for you would be to allow only odd numbers in the selection. Hint: Use XmNvalueChangedCallback:

<BR></P>

<PRE>XtAddCallback(aScale, XmNvalueChangedCallback, myfunction);</PRE>

<P>The callback will send a pointer to the structure of type XMScaleCallbackStruct. where myfunction is defined as:

<BR></P>

<PRE>/**

*** Partial listing for not allowing even numbers for FM selection.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91年精品国产| 国产天堂亚洲国产碰碰| 婷婷久久综合九色国产成人 | 国产日韩精品一区二区三区在线| 久久婷婷国产综合国色天香| 国产精品入口麻豆九色| 亚洲视频网在线直播| 蜜臀av亚洲一区中文字幕| 成人性生交大片| 欧美夫妻性生活| 国产精品国产三级国产aⅴ入口 | 国产精品一二三四五| 久久国产精品区| gogogo免费视频观看亚洲一| 666欧美在线视频| 亚洲综合免费观看高清完整版在线 | 成人h精品动漫一区二区三区| 欧美老年两性高潮| 亚洲欧美色综合| 国产精品正在播放| 国产三级欧美三级日产三级99| 亚洲成人资源网| av一本久道久久综合久久鬼色| 欧美另类高清zo欧美| 亚洲欧洲制服丝袜| 99re这里都是精品| 中文字幕一区二区三区在线播放 | jlzzjlzz亚洲日本少妇| 色一情一伦一子一伦一区| www国产成人| 精品久久久久久久一区二区蜜臀| 国产欧美一区二区三区网站| 日本一道高清亚洲日美韩| 欧美在线免费观看亚洲| 国产精品第一页第二页第三页| 成人激情免费电影网址| 久久久噜噜噜久久中文字幕色伊伊| 日韩av电影天堂| 欧美日韩不卡在线| 国产校园另类小说区| 国产成人aaa| 亚洲码国产岛国毛片在线| 91玉足脚交白嫩脚丫在线播放| 国产精品国产三级国产三级人妇| 91美女福利视频| 日韩美女啊v在线免费观看| 色久优优欧美色久优优| 日本亚洲视频在线| 久久久久久麻豆| 91丨porny丨中文| 亚洲电影一区二区| 国产亚洲成aⅴ人片在线观看| 一本高清dvd不卡在线观看| 日本欧美一区二区在线观看| 日本一区二区视频在线| 欧美特级限制片免费在线观看| 精品一区二区av| 美腿丝袜亚洲三区| 久久精品一区二区三区四区| 国产精品一级黄| 午夜影院在线观看欧美| 国产三级精品三级| 69堂亚洲精品首页| 色94色欧美sute亚洲线路二| 91.麻豆视频| 蜜乳av一区二区三区| 亚洲国产人成综合网站| 综合激情成人伊人| 日本一区二区三区四区在线视频 | 在线视频国内自拍亚洲视频| 国内精品久久久久影院色| 午夜精品久久久久影视| 一区二区在线观看视频| 中文无字幕一区二区三区| 26uuu精品一区二区在线观看| 欧美日韩精品一区视频| 91久久精品国产91性色tv| 国产69精品久久777的优势| 国产一区二区三区免费观看| 日韩和欧美的一区| 亚洲午夜三级在线| 日韩不卡在线观看日韩不卡视频| 一区二区三区产品免费精品久久75| 亚洲欧洲成人精品av97| 自拍偷拍国产精品| 亚洲午夜精品久久久久久久久| 国产精品萝li| 中文字幕一区二区三区在线播放 | 国产在线不卡一区| 精品亚洲免费视频| 精品中文字幕一区二区| 99精品热视频| 91久久精品网| 色综合欧美在线视频区| 欧美一区二区三区系列电影| 久久综合丝袜日本网| 精品国产91九色蝌蚪| 日本一区二区动态图| 亚洲影院久久精品| 亚洲综合999| 久久精品国产99| 色av综合在线| 欧美大胆人体bbbb| 国产精品久久久久久久岛一牛影视 | 日韩你懂的电影在线观看| 国产欧美一区二区精品婷婷| 一区二区激情小说| 国内精品国产成人| 色综合一个色综合亚洲| 久久精品一区二区| 日韩av二区在线播放| 91电影在线观看| 国产亚洲欧美在线| 一区二区三区在线免费播放| 午夜久久久久久久久久一区二区| 成人午夜视频网站| 国产精品区一区二区三区| 国产福利一区在线观看| wwww国产精品欧美| 国产suv精品一区二区883| 丝袜国产日韩另类美女| 国产一区 二区 三区一级| 成人激情综合网站| 26uuu国产电影一区二区| 一区二区激情小说| 欧美日本一区二区三区四区| 自拍偷在线精品自拍偷无码专区| 亚洲第一成人在线| 高清在线成人网| 日韩欧美高清一区| 亚洲男人的天堂网| 精品一区二区三区日韩| 日韩欧美中文一区二区| 国产一区二区调教| 精品国产不卡一区二区三区| 国产精品911| 国产精品女主播av| 裸体在线国模精品偷拍| 久久亚洲综合色一区二区三区| 日韩电影免费在线| 久久久精品综合| 在线免费观看日韩欧美| 日韩va欧美va亚洲va久久| 欧美一级在线免费| 成人黄色在线视频| 日韩和欧美一区二区| 中文在线免费一区三区高中清不卡| av不卡在线观看| 免费成人深夜小野草| 亚洲色图清纯唯美| 欧美r级在线观看| jlzzjlzz欧美大全| 日韩精品一区二| 麻豆视频观看网址久久| 国产欧美中文在线| 日韩一级大片在线观看| 欧美日韩精品专区| 99久久99久久精品免费看蜜桃| 亚洲福中文字幕伊人影院| 成人免费在线播放视频| 在线视频一区二区免费| 国产69精品久久久久777| 国产伦精一区二区三区| 美洲天堂一区二卡三卡四卡视频| 亚洲欧美在线视频| 日韩丝袜情趣美女图片| 欧美久久久久中文字幕| 欧美在线观看一区二区| 在线视频国产一区| 欧美精品乱码久久久久久 | 午夜精品久久久久久久蜜桃app| 国产精品亲子乱子伦xxxx裸| 亚洲女同ⅹxx女同tv| 亚洲免费观看高清| 亚洲电影欧美电影有声小说| 亚洲综合色噜噜狠狠| 日本美女一区二区| 国产在线播放一区| 国产风韵犹存在线视精品| 成人午夜免费视频| 色欲综合视频天天天| 欧美精品日日鲁夜夜添| 精品国产三级a在线观看| 国产福利一区二区三区视频在线 | 天天综合色天天综合色h| 免费成人在线播放| gogo大胆日本视频一区| 欧美一级淫片007| 亚洲三级久久久| 狠狠色丁香九九婷婷综合五月| 成人综合婷婷国产精品久久蜜臀| 日本韩国欧美三级| 久久理论电影网| 五月婷婷综合激情| 白白色 亚洲乱淫| 欧美一级生活片| 亚洲福利视频一区二区| 91九色最新地址| 中文字幕亚洲一区二区va在线| 蜜桃视频一区二区三区|