Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Good source of X11 programming info? Post 302127386 by porter on Tuesday 17th of July 2007 05:43:03 PM
Old 07-17-2007
Quote:
Originally Posted by willil
I've found that checking for the interrupts can increase display times by 30-50%.
Look for the following:

1. XtAppAddWorkProc/XtAppRemoveWorkProc

2. XtAppNextEvent, XtAppPending, XtAppPeekEvent, XtAppProcessEvent, Xt DispatchEvent, XtAppMainLoop

3. XExposeEvent

I try and avoid threads with Xwindows programming.

One solution is to use XExposeEvents to accumulate invalidated rectangles into a region, then when the count hits zero, schedule a work proc to some some drawing. In the work proc do a small amount of drawing covering only the invalidated region, then remove what you have painted from that region. Then if the region is not empty, schedule another work proc.

Alternatively use one of the XtAppPending family of functions to see if there any any incoming messages, if not then continue with a small amout of drawing. As above, restrict yourself to only parts that have been indicated by an XExposeEvent.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

good book for unix shell programming

hi, i am ajay. I need a good book for shell programming. a book which covers from fundamental to advance shell programming. (3 Replies)
Discussion started by: ajaygodbole
3 Replies

2. AIX

Good source of AIX Specific Scripting?

Hi everyone, I need to write some AIX scripts (ksh?), kind of fast so I'm looking for somewhere to get a crash course in it. Are there any AIX Specific Scripting resource sites that anyone can recommend, really not getting a whole lot from google. Thanks in advance, Darren (3 Replies)
Discussion started by: dbridle
3 Replies

3. UNIX for Advanced & Expert Users

source reader info

Hi friends, I urgently need to know if there is any tool called source reader in C or Unix or Linux...... If so ..plz let me know the details.I am running out of time..... (0 Replies)
Discussion started by: vijaya2006
0 Replies

4. Shell Programming and Scripting

Good site for Shell Programming

Hi unixers, :) I found some Good sites for learning Shell Programming. I Hope they will be useful to all of You. http://steve-parker.org/forum/ http://www.e-learningcenter.com/freecourses.htm similarly ,if u find any very good sites for shell programming pls post them, so that they will... (6 Replies)
Discussion started by: ravi raj kumar
6 Replies

5. UNIX for Dummies Questions & Answers

Newbie needs help with Xlib / X11 programming,dunno who to ask,but you :(

Hi,I'm new here and to Unix also. I'm totall newbie. Here is what I have to do: -Basics of programming user interface with Xlib library -Xlib -Client/Server model of X-Windows system -Example of "Hello world" with button which changes text ,so that when u click displays another... (4 Replies)
Discussion started by: megane16v
4 Replies

6. UNIX for Advanced & Expert Users

Please advise good source of info about swapping

Hi Everyone, I have some misunderstanding about swapping. Is it true that swap a) required always (I mean I cannot set size 0 bytes) and b) some pages are saved on disk in idle time even free memory is enough ? Could you please advise some good reading about it? (10 Replies)
Discussion started by: sant
10 Replies

7. Shell Programming and Scripting

any good book for shell programming and scripting??

as title suggest i am looking for good book to start learning shell programming.please help me with this. (5 Replies)
Discussion started by: pvk21
5 Replies

8. Programming

Low level X11 programming

How to use X11 without Xlib not XCB? How draw window directly on low level? I must use anyway window manager like Motif? I have ridden that X11 has server-client architecture, client send via TCP/IP to port 6000 request for primitives and get replies. Where is detailed description of it? In X11... (0 Replies)
Discussion started by: AndrzejB
0 Replies

9. Programming

MOTIF programming and X11 client !

Hi there , i am interesting in MOTIF programming. One question : Is it right that in Motif GUI programming the actions are automaticly transformed and networked to other clients over the internet without network programming necessary ? Are the commands automatic transformed by the X11... (4 Replies)
Discussion started by: Zabo
4 Replies
XtAppPending()															    XtAppPending()

Name
  XtAppPending - determine whether any events are in an application's input queue.

Synopsis
  XtInputMask XtAppPending(app_context)
	 XtAppContext app_context;

Inputs
  app_context
	    Specifies the application context.

Returns
  An XtInputMask which indicates what kind of events, if any, are pending on app_context.

Description
  XtAppPending() returns a nonzero value if there are pending events from the X server, timer, or other input sources.

  The  return  value is a bit mask that is the OR of XtIMXEvent (an X event), XtIMTimer (a timer event-see XtAppAddTimeOut()), and XtIMAlter-
  nateInput (an alternate input event-see XtAppAddInput()).  As a convenience, the symbolic name XtIMAll is defined as the bitwise  inclusive
  OR  of all event types.  If no events are pending, XtAppPending() flushes the output buffers of each display in the application context and
  returns zero.  This call is the Intrinsics equivalent to the Xlib call XPending().

  XtAppPending() never blocks.

Usage
  Programs rarely need this much control over the event dispatching mechanism.	Most programs use XtAppMainLoop().

Structures
  The XtInputMask type and its possible values are defined as follows:

     typedef unsigned long    XtInputMask;

     #define XtIMXEvent 	     1
     #define XtIMTimer		     2
     #define XtIMAlternateInput      4
     #define XtIMAll (XtIMXEvent   XtIMTimer   XtIMAlternateInput)

See Also
  XtAppAddInput(1), XtAppAddTimeOut(1), XtAppMainLoop(1), XtAppNextEvent(1), XtAppPeekEvent(1), XtAppProcessEvent(1), XtDispatchEvent(1).

Xt - Event Handling														    XtAppPending()
All times are GMT -4. The time now is 07:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy