Re: newbie �resource temporarily unavailable� questi on

2012-06-29 Thread Alan Corey
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 
>


-- 
Credit is the root of all evil.  - AB1JX
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com


Re: newbie ???resource temporarily unavailable??? questi on

2012-06-29 Thread Thomas Dickey
On Fri, Jun 29, 2012 at 08:21:04PM +0100, Glynn Clements wrote:
> 
> Alan Corey wrote:
> 
> > I'm just plinking around after having read the early chapters of the
> > O'Reilly volumes 4a and 6a plus some Athena and Xlib stuff. I was
> > itching to try some things.  For my background see
> > http://ab1jx.webs.com  For graphics programming I've mostly worked in
> > Turbo Pascal and Delphi.
> 
> Okay, so you've progressed from the 1980's to the 1990's ;)
> 
> 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.

...in contrast to the usual 6-9 months(*) that it takes Xorg hackers to
notice that they've broken something more critical.

(*) not talking about build failures - a week or two seems to suffice there

-- 
Thomas E. Dickey 
http://invisible-island.net
ftp://invisible-island.net


signature.asc
Description: Digital signature
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com

Re: newbie �resource temporarily unavailable� questi on

2012-06-29 Thread Glynn Clements

Alan Corey wrote:

> I'm just plinking around after having read the early chapters of the
> O'Reilly volumes 4a and 6a plus some Athena and Xlib stuff. I was
> itching to try some things.  For my background see
> http://ab1jx.webs.com  For graphics programming I've mostly worked in
> Turbo Pascal and Delphi.

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

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.

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

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

> when I try
> to use XCopyPlane to copy to the Panner I get the unavailable message.
>  I can use XDrawSegments directly on the Panner (well, once anyway),
> copy the grid into another Pixmap with XCopyPlane, most other things
> seem to work.Aside from the unavailable message I get a black
> rectangle where the Pixmap should be.  Nothing shows up in
> /var/log/Xorg.0.log about it, and it's not fatal: I can keep running
> the program.  I wouldn't have known it was there except I put a perror
> after the XCopyPlane to investigate the black Pixmap.

I think that you may be chasing a phantom here.

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.

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).

IOW, it's not an error; in fact, I wouldn't be surprised if
practically every Xlib call could set errno to EAGAIN even when the
call completes successfully.

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.

-- 
Glynn Clements 
___
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.x.org/mailman/listinfo/xorg
Your subscription address: arch...@mail-archive.com