Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2002-07

Any examples using x11 units?

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Nikolai Zhubr

Hi all,
(I appologise if this is not exactly the right place to ask,) are there any fpc projects/examples/demos/whatever using x11 units rather than wrapping to some toolkits?
I've looked through contribs and found none.
Any hints or refs appreciated.

Best regards, Nikolai Zhubr
Georgi Georgiev
to Nikolai Zhubr

I'm traing to test if there is some input
bytes ready in stdin. When i try this with normal
file, all is ok - SelectText function from Linux unit give me n>0 if any character is ready.

When i try with file 'input', SelectText give me 0 until 2 lines are entered. How to go round this
without using old and more low-level libs like crt ?

------- test program -------

program test;
uses Linux;
var n:longint; w:char; TV:TimeVal;
begin
 TV.sec:=0; TV.usec:=0;
 repeat
  n:=SelectText(input,@TV);
  if n>0 then begin
    read(w); write(w);
    write('[',n,']');
  end;
 until eof(input);
end.

--------- test results: ----------

1234
abcd
1[1]2[1]3[1]4[1]
[1]ABCD
a[1]b[1]c[1]d[1]
[1]

--------- must be: ---------------

1234
1[1]2[1]3[1]4[1]
[1]abcd
a[1]b[1]c[1]d[1]
[1]ABCD

----------------------------------

=====
Skelet
====== http://skelet.hit.bg

__________________________________________________ Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Anton Tichawa
to Nikolai Zhubr: (I appologise if this is not exactly the right place to ask,) are there any fpc…

hello,

I've written a small example program that opens a window, displays a rotating line, listens for mouse movement and keyboard messages and displays mouse positions and key codes. The program uses (imports) just X, Xlib, and Linux.

I have not yet included timers, so I still use delays, and the program consumes much of the CPU performance.

If you want to have a copy, just send me an email.

Best regards,

Anton Tichawa

you wrote 6 lines
Hi all, (I appologise if this is not exactly the right place to ask,) are there any fpc projects/examples/demos/whatever using x11 units rather than wrapping to some toolkits? I've looked through contribs and found none. Any hints or refs appreciated.
Anton Tichawa
to Georgi Georgiev: I'm traing to test if there is some input bytes ready in stdin. When i try this with…

hello,

you can use 'select', look at the man page.

hth,

Anton Tichawa

you wrote 59 lines
I'm traing to test if there is some input bytes ready in stdin. When i try this with normal file, all is ok - SelectText function from Linux unit give me n>0 if any character is ready. When i try with file 'input', SelectText give me 0 until 2 lines are entered. How to go round this without using old and more low-level libs like crt ? ------- test program ------- program test; uses Linux; var n:longint; w:char; TV:TimeVal; begin TV.sec:=0; TV.usec:=0; repeat n:=SelectText(input,@TV); if n>0 then begin read(w); write(w); write('[',n,']'); end; until eof(input); end. --------- test results: ---------- 1234 abcd 1[1]2[1]3[1]4[1] [1]ABCD a[1]b[1]c[1]d[1] [1] --------- must be: --------------- 1234 1[1]2[1]3[1]4[1] [1]abcd a[1]b[1]c[1]d[1] [1]ABCD ---------------------------------- ===== Skelet ====== http://skelet.hit.bg __________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Nikolai Zhubr
to Anton Tichawa: I've written a small example program that opens a window, displays a rotating line,…

Hi,

Anton Tichawa wrote 5 lines
hello, I've written a small example program that opens a window, displays a rotating line, listens for mouse movement and keyboard messages and displays mouse positions and key codes. The program uses (imports) just X, Xlib, and Linux.

Ok. Thanks for replying.
I've just finished something like that, but even simpler. Approx one page of code. (I mean, it also works ;)
And, it looks like xlib.pp is not quite valid. For example, TXPointer is used almost everywhere instead of PXPointer, which breaks stuff. As far as I understood, x11 package is pure autotranslated, so no big surprise. I just wonder how do people use it?
Question 1: Is anyone going to fix it?
Question 2: If no, should I submit patches?

Best regards, Nikolai Zhubr > I have not yet included timers, so I still use delays, and the program > consumes much of the CPU performance. > If you want to have a copy, just send me an email. > Best regards, > Anton Tichawa > On Tuesday 23 July 2002 02:46, you wrote: >> Hi all, >> (I appologise if this is not exactly the right place to ask,) >> are there any fpc projects/examples/demos/whatever using x11 units >> rather than wrapping to some toolkits? >> I've looked through contribs and found none. >> Any hints or refs appreciated. > _______________________________________________ > fpc-pascal maillist - > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Georgi Georgiev
to Anton Tichawa: you can use 'select', look at the man page. Anton Tichawa

--- Anton Tichawa wrote: >
hello,

you can use 'select', look at the man page.

For file 'input' effect is the same - select
return nonzero value after the second Enter !

Show quoted text 11 lines
hth, Anton Tichawa On Tuesday 23 July 2002 15:36, you wrote: > .... > > When i try with file 'input', SelectText give me 0 > until 2 lines are entered. ... >

=====
Skelet
====== http://skelet.hit.bg

__________________________________________________ Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com