discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Renaissance - LPT_Interface.app - implementing button action


From: csanyipal
Subject: Renaissance - LPT_Interface.app - implementing button action
Date: Tue, 17 Aug 2010 17:22:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi,

I develope the LPT_Interface.app and the gsmarkup file for the app
window is ready.

Now I want to give actions to buttons but don't know how to implement
these actions into the applicaton?

Say, the button is toggle type and it should to set, or reset a bit in
the parallel Data port.

To write to the Data port bit the code is in C:
-------*
#include <stdio.h>
#include <stdlib.h>
#include <sys/io.h>

#define base 0x378           /* printer port base address */
#define value 1              /* numeric value to send to printer port */

main(int argc, char **argv)
{
   if (-1 == ioperm(base,1,1))
    fprintf(stderr, "Couldn't get the port at %x\n", base), exit(1);

   outb(value, base);
}
-------*

and this must run with root privileges.

How can I implement this code in to the application?

Because the button is toggle type I must to write the code so so when
the button has title="1" then the action code must to write logical 1 to
the Data Port bit, but when the button title="0" then it must to write
logical 0 to the bit.

Is it good to write this code in main.m file?

Also, how can I achieve that that the Error messages appeares in the
label text which id="StatLine"?

Any advices will be appreciated!

-- 
Regards, Paul Chany
You can freely correct me in my English.
http://csanyi-pal.info




reply via email to

[Prev in Thread] Current Thread [Next in Thread]