Re: newbie �resource temporarily unavailable� questi on

Alan Corey alan01346 at gmail.com
Fri Jun 29 21:20:59 PDT 2012


Well, you see, I just really dislike C++.  I've tried on and off for
years and I just can't get it through my head.  I want a toolkit I can
program in C.  FLTK seems great, same with GTK, but not without C++.
I'm familiar with OO programming concepts from Java, Delphi and Perl
but C++?  Uh-uh.

>
> Okay, so you've progressed from the 1980's to the 1990's ;)
>

Naw, I've still got a couple 286 DOS laptops.  I keep 'em because
they'll run on 5 watts. OTOH, if you could hook a real keyboard to a
Kindle Fire that would blow them away.

> I wouldn't advise putting too much effort into Xt/Xaw stuff; they've
> fallen so far into disuse that if X.org shipped a totally
> non-functional version of one of those libraries, it might take a year
> before anyone actually noticed.

Wouldn't that break a bunch of things that rely on them?

>
> And Xlib itself is slowly heading the same way; XRender and OpenGL are
> frequently preferred for the graphics side.

Yeah, I should probably learn OpenGL, but I'm more interested in
scientific plotting type graphics than artsy 3D stuff.  I don't do
games at all.  I just want control of my pixels.

>
> OTOH, a basic understanding of the principles underlying X is never a
> bad thing to have.

I guess I don't have a clear idea of what's built on what.  I know
Athena's just a "suggested" toolkit, but I thought Xt was built into
X. I'm not doing much of anything with Motif, open or otherwise. The
main thing I dislike about the older stuff is scrollbars like in XTerm
where you have to right click to go up in tiny steps.

> Once something sets errno, it usually stays set until something
> explicitly clears it. errno should only be considered meaningful in
> the event that a function returns an error status (most Xlib functions
> don't) and the function's documentation states that errno will be set
> in this situation.

I noticed that.  I almost always check returns, especially when things
aren't working right.  That's why I tried perror when I got the black
rectangle.

>
> This is particularly applicable to "resource temporarily unavailable",
> which is the message for the EAGAIN code. This often just means that a
> non-blocking operation (such as read() or write() on a non-blocking
> descriptor) cannot produce any data available right now (read() cannot
> return 0 in this situation because that indicates EOF).

But it could set errno.

> As for your black rectangle, you'll need to look elsewhere. Are you
> copying the correct plane? Are the foreground and background colours
> of the GC set correctly? If you used an XColor to determine the
> numeric value for the colours, don't forget that XColour uses 16-bit
> values (0..65535) for the components; if you use 8-bit values
> (0..255), you can have any colour you like so long as it's black.

I'll look into these things.  I'm running 24 bit color, and editres
shows the depth of my widgets is 24.  I haven't found a good
discussion of GCs yet but I'll look for one.  For example programs I'm
using XLoad and the XBitmap programs from the O'Reilly book. I was
mostly using anything to satisfy compiler warnings for GCs, but it
makes sense that they could have an effect like this.  And no, I don't
know that I'm copying the right plane.  I was using XCopyArea until I
changed it to plane at the last minute because the depth wasn't 1.

What I'm trying to do (right now) is something like
http://ab1jx.webs.com/toys/audread/index.html that doesn't rely on
Gnuplot for plotting and Qiv for viewing.  That works, but it's not
interactive enough.  Something like XOscope but simpler and so that it
runs under OpenBSD.

I do appreciate the answers.  I've saved your email so I can look at
it more offline.

Thank you,

  Alan
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>


-- 
Credit is the root of all evil.  - AB1JX



More information about the xorg mailing list