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 - SOLVED


From: Csanyi Pal
Subject: Re: LPT_Interface.app - implementing button action - SOLVED
Date: Sun, 03 Oct 2010 15:22:00 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Germán Arias <german@xelalug.org> writes:

>> [code]
>> NSString *title = [sender title];
>> 
>>  if ([title isEqualToString: @"1"])
>>    {
>>      [StatLine setStringValue: @"write logical 1 to the data port"];
>>    }
>>  else if ([title isEqualToString: @"0"])
>>    {
>>      [StatLine setStringValue: @"write logical 0 to the data port"];
>>    }
>> [/code]

> I think you can solve this using tags. Something like:
>
> <botton title="something" tag=1 />
>
> And then you can use these on your code. For example:
>
>       
>       if ([sender tag] == 1)
>       {
>         [sender setTag: anotherNumber....     
>       .....
>       .....
>
> As the tags don't have relationship with the button's titles. You can
> use the necesary tags to the control.

I solve this problem with the code:

[code]
if ([sender state] == 1)
   {
      // Value of the Status Port Byte shown in HexaDecimal scale.
     [StatLine setStringValue: @"Value of the Status Port Byte shown in 
HexaDecimal scale."];

   }
else if ([sender state] == 1)
   {
      // Value of the Status Port Byte shown in Binary scale.
     [StatLine setStringValue: @"Value of the Status Port Byte shown in Binary 
scale."];
   }
[/code]

However, I don't know whether is this a GNUstep Renaissance bug because
the 'title isEqualToString: @"0"]' doesn't work?

-- 
Regards, Paul Chany
<http://www.debian.org> <http://wiki.debian.org/DebianEdu>
<http://sourceforge.net/projects/lptinterface/>
<http://csanyi-pal.info>




reply via email to

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