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

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

?? unx47.htm

?? Unix Unleashed, Third Edition is written with the power user and system administrator in mind. This
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<HTML>

<HEAD>

<TITLE>UNIX Unleashed unx47.htm</TITLE>

<LINK REL="ToC" HREF="index.htm">

<LINK REL="Next" HREF="unxwotcd.htm">

<LINK REL="Previous" HREF="unx46.htm"></HEAD>

<BODY TEXT="#000000" LINK="#0000FF" VLINK="#800080" bgcolor=white>

<P><A HREF="unx46.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index.htm"><IMG SRC="blutoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="unxwotcd.htm"><IMG SRC="blunext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>

<A HREF="index.htm"><IMG SRC="bluprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Home"></A>

</P><UL>

<UL>

<LI>

<A HREF="#I1">47 &#151; UNIX Graphical User Interfaces for Programmers</A></LI>

<UL>

<UL>

<UL>

<LI>

<A HREF="#I2">By Karman Husain</A></LI></UL></UL>

<LI>

<A HREF="#I3">Writing Motif Applications</A></LI>

<LI>

<A HREF="#I4">Naming Conventions</A></LI>

<LI>

<A HREF="#I5">Writing Your First Motif Application</A></LI>

<LI>

<A HREF="#I6">Compiling This Application</A></LI>

<LI>

<A HREF="#I7">The Widget Hierarchy</A></LI>

<UL>

<LI>

<A HREF="#I8">Core</A></LI>

<LI>

<A HREF="#I9">XmPrimitive</A></LI>

<LI>

<A HREF="#I10">XmManager</A></LI></UL>

<LI>

<A HREF="#I11">The Label Widget</A></LI>

<LI>

<A HREF="#I12">Strings in Motif Compound Strings</A></LI>

<LI>

<A HREF="#I13">The PushButton Widget</A></LI>

<UL>

<LI>

<A HREF="#I14">The Toggle Button Widget</A></LI></UL>

<LI>

<A HREF="#I15">Convenience Functions</A></LI>

<LI>

<A HREF="#I16">The List Widget</A></LI>

<LI>

<A HREF="#I17">The Scrollbar Widget</A></LI>

<LI>

<A HREF="#I18">The Text Widget</A></LI>

<LI>

<A HREF="#I19">The Bulletin Board Widget</A></LI>

<LI>

<A HREF="#I20">The RowColumn Widget</A></LI>

<LI>

<A HREF="#I21">The Form Widget</A></LI>

<LI>

<A HREF="#I22">Designing Layouts</A></LI>

<LI>

<A HREF="#I23">Menus</A></LI>

<UL>

<LI>

<A HREF="#I24">Popup</A></LI>

<LI>

<A HREF="#I25">The Menu Bar</A></LI>

<LI>

<A HREF="#I26">The Options Menu</A></LI>

<LI>

<A HREF="#I27">Accelerators and Mnemonics</A></LI></UL>

<LI>

<A HREF="#I28">Dialog Boxes</A></LI>

<UL>

<LI>

<A HREF="#I29">Modes of a Dialog Box</A></LI></UL>

<LI>

<A HREF="#I30">Events</A></LI>

<LI>

<A HREF="#I31">Pointer Events</A></LI>

<LI>

<A HREF="#I32">Keyboard Events</A></LI>

<LI>

<A HREF="#I33">Window Crossing Events</A></LI>

<UL>

<LI>

<A HREF="#I34">Event Masks</A></LI>

<LI>

<A HREF="#I35">Managing the Queue</A></LI>

<LI>

<A HREF="#I36">Work Procedures</A></LI>

<LI>

<A HREF="#I37">Using Timeouts</A></LI>

<LI>

<A HREF="#I38">Other Sources</A></LI></UL>

<LI>

<A HREF="#I39">Handling Output</A></LI>

<UL>

<LI>

<A HREF="#I40">The Graphics Context</A></LI></UL>

<LI>

<A HREF="#I41">Drawing Lines, Points, Arcs, and Polygons</A></LI>

<UL>

<LI>

<A HREF="#I42">Drawing a Line</A></LI>

<LI>

<A HREF="#I43">Drawing a Point</A></LI>

<LI>

<A HREF="#I44">Drawing Arcs</A></LI>

<LI>

<A HREF="#I45">Using Fonts and Fontlists</A></LI></UL>

<LI>

<A HREF="#I46">The X Color Model</A></LI>

<UL>

<LI>

<A HREF="#I47">Pixmaps, Bitmaps, and Images</A></LI></UL>

<LI>

<A HREF="#I48">GUI Builders and Management Tools</A></LI>

<LI>

<A HREF="#I49">A Few Commercial GUI Builders</A></LI>

<LI>

<A HREF="#I50">What You Have Learned in this Chapter</A></LI>

<LI>

<A HREF="#I51">Acknowledgements</A></LI>

<LI>

<A HREF="#I52">References</A></LI></UL></UL></UL>



<H2 ALIGN="CENTER">

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

<FONT SIZE=5><B>47 &#151; UNIX Graphical User Interfaces for Programmers</B>

<BR></FONT></A></CENTER></H2>

<H5 ALIGN="CENTER">

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

<FONT SIZE=3><B>By Karman Husain</B>

<BR></FONT></A></CENTER></H5>

<H3 ALIGN="CENTER">

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

<FONT SIZE=4><B>Writing Motif Applications</B>

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

<P>This chapter will serve as an introduction to event-driven programming. After reading this chapter, you will have enough information to write your own application. Keep in mind, though, that writing Motif applications is perhaps not the easiest task in 

the world, nor is it the most complex. As with any other system, you will learn new ways of doing things. In Motif, you have to get used to programming in an event-driven environment. A typical C application runs from start to finish at its own pace. When 

it needs information, it looks for it from a source such as a file or the keyboard, and gets the information almost as soon as it asks for it. However, in event-driven programming, applications are executed on an asynchronous basis. That is, the order and 

time of arrival of each event is not deterministic. The application waits for an event to occur and then proceeds based on that event. Thus the term &quot;event-driven programming.&quot;

<BR></P>

<P>In the case of X Window programming, an application must wait for events on the input queue. Similarly, a server waits for an event from a client and then responds based on the type of event received. This event handling and other aspects of X 
programming are handled by a toolkit called the Xt ToolkitIntrinsics, or Xt for short.

<BR></P>

<P>In Xt, an application typically runs in a loop forever. This loop is called an event loop, and an application enters it by calling the function XtAppMainLoop. While in this event loop, the application will always wait for an event, and will either 
handle it itself or more likely &quot;dispatch&quot; the event to a window or widget.

<BR></P>

<P>A widget registers functions that it wants called when a type of event is received. This function is called a callback function. In most cases, a callback function is independent of the entire application. For example, some widgets will redraw 
themselves when a Pointer button is clicked in their display area. In this case, they would register a redraw callback function on a button click. Xt also supports &quot;actions,&quot; which allow applications to register a function with Xt. An action is 
called when one or more sequences of specific event types are received. For example, Ctrl+X would call the exit function. The mapping of the action to an event is handled through a translation table within Xt. Functions which handle specific events are 
referred to as &quot;event handlers.&quot;

<BR></P>

<H3 ALIGN="CENTER">

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

<FONT SIZE=4><B>Naming Conventions</B>

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

<P>By default, most X lib functions begin with the letter &quot;X&quot;, but sadly this is not a rule to rely on. Several macros and functions do not begin with X, such as BlackColor, WhiteColor, etc. In general, if a name in Xlibrary begins with X, it's a 

function. If a name begins with any other capital letter, it's a macro.

<BR></P>

<P>With Xt, the naming conventions get better, but only slightly. In Xt, macros are not differentiated from functions.

<BR></P>

<HR ALIGN=CENTER>

<NOTE>

<IMG SRC="imp.gif" WIDTH = 68 HEIGHT = 35><B>TIP:</B> Do not rely on the name of a toolkit function to tell you whether it's a macro or not. Read the manual.

<BR></NOTE>

<HR ALIGN=CENTER>

<P>In Motif, almost all declarations begin with Xm. XmC refers to a class. XmR refers to a resource. XmN refers to a name. XtN refers to Xt resources used by Motif.

<BR></P>

<P>In Motif, declarations ending with the words WidgetClass define the base class for a type of widget. Other conventions to remember about parameters passed in most X library function calls are: Width is always to the left of height. x is to the left of 
y. Source is to the left of destination. Display is usually the first parameter.

<BR></P>

<P>With practice, you will be able to identify the types of parameters to pass and which toolkit a function belongs to, and you'll be able to &quot;guess&quot; what parameters an unknown function might expect.

<BR></P>

<H3 ALIGN="CENTER">

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

<FONT SIZE=4><B>Writing Your First Motif Application</B>

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

<P>See 47_1.c on the CD-ROM for a complete listing showing the basic format for a Motif application.

<BR></P>

<P>The listing shows an application in which a button attaches itself to the bottom of a form. No matter how you resize the window, the button will always be on the bottom. The application does the following things:

<BR></P>

<UL>

<LI>Initializes the toolkit to get a Shell widget.

<BR>

<BR></LI>

<LI>Makes a Form widget.

<BR>

<BR></LI>

<LI>Manages all widgets as they are created.

<BR>

<BR></LI>

<LI>Makes a Button widget and puts it on top of the Form widget.

<BR>

<BR></LI>

<LI>Attaches a callback function to the button.

<BR>

<BR></LI>

<LI>Realizes the widget (that is, makes the hierarchy visible).

<BR>

<BR></LI>

<LI>Goes into its event loop.

<BR>

<BR></LI></UL>

<P>Let's look at the application in more detail. The #include files in the beginning of the file are required for most applications. Note the following files:

<BR></P>

<PRE>#include &lt;X11/Intrinsic.h&gt;

#include &lt;Xm/Xm.h&gt;</PRE>

<P>These declare the definitions for XtIntrinsics and Motif, respectively. Some systems may not require the first inclusion, but it's harmless to put it in there because multiple inclusions of Intrinsic.h are permitted. In addition, each Motif widget 
requires its own header file. In Listing 47.1, the two widgets Form and PushButton require the following header files:

<BR></P>

<PRE>#include &lt;Xm/Form.h&gt;

#include &lt;Xm/PushB.h&gt;</PRE>

<P>The variables in the program are declared in the following lines:

<BR></P>

<PRE>Widget top;

XtAppContext app;

Widget aForm;

Widget aButton;

int    n;</PRE>

<P>The top, aForm, and aButton represent widgets. Even though their widget types are different, they can all be referred to as widgets.

<BR></P>

<P>The XtAppContext type is an &quot;opaque&quot; type, which means that a Motif programmer does not have to be concerned about how the type is set up. Widgets are opaque types as well, because only the items that are required by the programmer are 
visible.

<BR></P>

<P>The first executable line of the program calls the XtAppInitialize() function. This will initialize the Xt toolkit and create an application shell and context for the rest of the application. This value is returned to the widget &quot;top&quot; (for top 

level shell). This widget will provide the interface between the window manager and the rest of the widgets in this application.

<BR></P>

<P>The application then creates a Form widget on this top-level widget. A Form widget places other widgets on top of itself. It is a Manager widget because it &quot;manages&quot; other widgets.

<BR></P>

<P>There are two steps for displaying a widget: Managing it and realizing it.

<BR></P>

<P>Managing a widget allows it to be visible. If a widget is unmanaged, it will never be visible. By managing a widget, the program gives the viewing control over to the windowing system so it can display it. If the parent widget is unmanaged, any child 
widgets remain invisible even if managed.

<BR></P>

<P>Realizing a widget actually creates all the subwindows under an application and displays them. Normally only the top-level widget is realized after all the widgets are managed. This call will realize all the children of this widget.

<BR></P>

<P>Note that realizing a widget takes time. A typical program will manage all the widgets except the topmost widget. This way the application will only call XtRealizeWidget on the topmost parent when the entire tree has to be displayed. You have to realize 

a widget at least once, but you can manage and unmanage widgets as you want to display or hide them.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩视频免费观看高清在线视频| 久久九九全国免费| 亚洲综合在线视频| 91网站最新网址| 国产精品久久综合| 成人黄色国产精品网站大全在线免费观看| 91成人免费在线| 一区二区三区波多野结衣在线观看| av中文字幕不卡| ...av二区三区久久精品| 91在线码无精品| 一区av在线播放| 欧美视频完全免费看| 午夜视黄欧洲亚洲| 日韩情涩欧美日韩视频| 亚洲视频 欧洲视频| 国产不卡视频在线观看| 中文字幕精品三区| 99综合影院在线| 一区二区三区成人| 这里只有精品99re| 激情综合色播激情啊| 国产色一区二区| www.色综合.com| 亚洲一区电影777| 日韩一区二区三| 国产激情精品久久久第一区二区| 国产精品蜜臀av| 91国模大尺度私拍在线视频| 亚洲国产va精品久久久不卡综合 | 一区二区成人在线观看| 欧美日韩亚洲另类| 激情国产一区二区 | 欧美猛男男办公室激情| 日本亚洲天堂网| 久久久一区二区三区| 99精品一区二区三区| 一区二区在线观看视频在线观看| 91国产丝袜在线播放| 久久成人麻豆午夜电影| 国产精品国产三级国产有无不卡| 欧美色中文字幕| 激情丁香综合五月| 亚洲精品国产成人久久av盗摄| 欧美中文字幕不卡| 麻豆精品一区二区| 亚洲日本一区二区三区| 精品国产污污免费网站入口| aaa亚洲精品| 日本视频在线一区| 日韩伦理av电影| 欧美成人女星排名| 国产91色综合久久免费分享| 亚洲一区二区三区四区中文字幕| 日韩一区二区麻豆国产| 99精品国产99久久久久久白柏| 美脚の诱脚舐め脚责91| 一区二区三区四区在线播放| 欧美成人精品二区三区99精品| 在线一区二区三区| 国产传媒久久文化传媒| 亚洲最新视频在线播放| 国产网红主播福利一区二区| 色综合久久综合网97色综合| 国产麻豆精品久久一二三| 天堂久久久久va久久久久| 国产精品初高中害羞小美女文| 日韩亚洲欧美一区| 在线观看视频91| 国产在线不卡视频| 日本中文一区二区三区| 亚洲综合色自拍一区| 中文字幕第一区综合| 精品国产凹凸成av人网站| 欧美日韩国产首页在线观看| www..com久久爱| 免费的成人av| 亚洲高清不卡在线| 一区在线观看免费| 国产亚洲精久久久久久| 欧美大片一区二区三区| 欧美福利一区二区| 99久久免费精品高清特色大片| 国产伦精品一区二区三区免费| 丝瓜av网站精品一区二区| 亚洲自拍欧美精品| 自拍偷在线精品自拍偷无码专区| 亚洲国产精品av| 国产精品私人影院| 日韩视频在线观看一区二区| 欧美日韩中文国产| 欧美日韩亚洲综合一区| 欧美日韩成人高清| 91麻豆精品91久久久久久清纯| 欧美日韩免费观看一区二区三区| 91成人在线免费观看| 色婷婷av一区二区三区大白胸| 波多野结衣中文字幕一区二区三区 | 粉嫩av一区二区三区| 蜜臀久久久久久久| 精品一区二区免费在线观看| 久久精品国内一区二区三区| 国产在线国偷精品产拍免费yy| 国内久久精品视频| 成人一区二区三区在线观看| 九九国产精品视频| 国产又黄又大久久| 国产成人免费在线| av午夜一区麻豆| 欧美少妇xxx| 日韩精品一区二区三区swag| 国产欧美一区二区三区鸳鸯浴 | 91麻豆自制传媒国产之光| 国产91丝袜在线播放| 91丨九色丨蝌蚪丨老版| 欧美日韩视频专区在线播放| 日韩一区二区三区在线| 久久新电视剧免费观看| 精品久久一区二区| 国产精品拍天天在线| 欧美精品一区视频| 亚洲在线观看免费| 国产高清亚洲一区| 欧美精品色综合| 国产精品不卡在线| 久久国产精品72免费观看| 欧美在线观看视频一区二区| 久久精品欧美一区二区三区不卡 | 日韩在线观看一区二区| 国产盗摄女厕一区二区三区| 欧美精品自拍偷拍| 亚洲欧洲成人精品av97| 国产在线视频一区二区| 欧美美女激情18p| 亚洲欧美日韩在线| 国产高清精品在线| 精品粉嫩超白一线天av| 午夜精品福利久久久| 91美女视频网站| 中文字幕色av一区二区三区| 国产一区二区久久| 欧美成人vr18sexvr| 天天综合网天天综合色| 91官网在线观看| 亚洲手机成人高清视频| 国产美女在线精品| 久久这里只有精品视频网| 日本少妇一区二区| 欧美日韩一区二区三区在线看| 亚洲视频一区二区免费在线观看 | 一级精品视频在线观看宜春院| 国产高清无密码一区二区三区| 欧美成人a∨高清免费观看| 亚洲一卡二卡三卡四卡五卡| 91啪九色porn原创视频在线观看| 欧美极品少妇xxxxⅹ高跟鞋 | 精品久久人人做人人爽| 毛片不卡一区二区| 欧美一级日韩免费不卡| 日韩在线一区二区三区| 欧美日本一区二区| 亚洲国产精品一区二区www在线| 色域天天综合网| 一区二区免费在线播放| 欧洲中文字幕精品| 亚洲高清不卡在线观看| 欧美日韩国产小视频在线观看| 亚洲mv在线观看| 7777精品伊人久久久大香线蕉 | 亚洲伦理在线精品| 色综合久久久久综合体桃花网| 亚洲免费观看高清完整版在线 | 久久久精品蜜桃| 国产不卡在线播放| 自拍偷在线精品自拍偷无码专区| 91美女视频网站| 五月婷婷色综合| 日韩精品一区国产麻豆| 国产一区二区视频在线| 国产精品丝袜91| 日本乱码高清不卡字幕| 亚洲一区二区三区免费视频| 欧美日韩一区不卡| 免费在线成人网| 国产欧美一区二区在线观看| 99视频精品免费视频| 一区二区三区精密机械公司| 91精品国产乱| 丰满白嫩尤物一区二区| 伊人开心综合网| 欧美xxxx在线观看| 成人国产精品免费观看| 亚洲成在人线免费| 久久久久久久综合色一本| 91在线你懂得| 久久国产福利国产秒拍| 中文字幕在线不卡一区| 欧美日本一区二区三区| 高清国产午夜精品久久久久久| 亚洲综合成人在线|