discuss-gnustep
[Top][All Lists]
Advanced

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

Re: LPT_Interface.app - implementing button action


From: Csanyi Pal
Subject: Re: LPT_Interface.app - implementing button action
Date: Sun, 12 Sep 2010 01:23:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Nicola Pero <nicola.pero@meta-innovation.com> writes:

>> 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.
>
> Your button has an action, and a target.  For example,
>
>  <button action="togglePort:" target="#NSOwner" />
>
> this means that when the button is clicked, the 'togglePort:' method
> of your #NSOwner object will be invoked.
>
> So, all you need to do is implement it:
>
> /* (inside the @implementation of the class from which you instantiate
> the #NSOwner) */

I implemented it as you can see in attachment of this mail.

Attachment: LPT_InterfaceAblaka.gsmarkup
Description: LPT_InterfaceAblaka.gsmarkup

My first question is: why doesn't show the text in case if title
isEqualToString: @"0" ?

[code]
else if ([title isEqualToString: @"0"])
  {
     // "write logical 0 to the data port"
    [StatLine setStringValue: @"write logical 0 to the data port"];
[/code]

My second question is: why doesn't show up the application icon with the
specified LPT_Interface_48.tiff image but with the GNUstep.tiff image?
I'm using Window Maker as window manager.

My third question is: the code in main.m file:
 ioperm(base,1,1);
 outb((unsigned char)1, base);

must be run with root permissions. How can I achieve this goal in my
application? 

If one want to, may download the application from:
ftp://csanyi-pal.info/objective-c/LPT_Interface.tar.bz2

Any advices will be appreciated!

-- 
Regards, Paul Chany
http://www.debian.org
http://wiki.debian.org/DebianEdu
http://csanyi-pal.info

reply via email to

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