comp.lang.ada
 help / color / mirror / Atom feed
* Mapping between Ada95 (AppletMagic from Intermetrics Inc) and Java
@ 1997-01-10  0:00 FREBOURG Fabrice
  1997-01-11  0:00 ` Craig E. Ransom
  0 siblings, 1 reply; 2+ messages in thread
From: FREBOURG Fabrice @ 1997-01-10  0:00 UTC (permalink / raw)



Hello, 

I've a problem to execute an applet with Ada95. (cross-compilator AppletMagic)
I've created a quit button on a frame. When I'm clicking on such a button, I must 
normally trigger is its associate operation. This operation is called action.

If I'm cliking on my button, there is nothing. It's as if my function action wasn't
take by the event manager. Do you know how I can lay my action function to the event
manager in order to execute an exit of my applet. (In Ada, I've got any problem to compile.)

In Java, here is the following code:

public boolean action(Event e,Object arg) {

if ("Quit".equals(arg)) {
dispose();
System.exit(0);
return true;
}
return false;
} // action

other way

private Button quit_button;
.
.
.

public boolean action(Event e,Object arg) {

if (e.target == quit_button ) then
dispose();
System.exit(0);
return true;
} // end if
return false;
} // action

In Ada 95, I'm suggesting this code which is correct, but It does nothing:

with interfaces.java; use interfaces.java;
with java.lang; use java.lang;
with java.lang.String; use java.lang.String;
with java.awt.Frame; use java.awt.Frame;
with java.awt.Event; use java.awt.Event;
with java.awt.Container; use java.awt.Container;
with java.awt.Component; use java.awt.Component;
with java.awt.Button; use java.awt.Button;
.
.
.

	function action(Obj : access Button_Obj;
        		evt : Event_Ptr;
        		what : Object_Ptr)
			return boolean is
            
        Quit:constant String_Ptr:=+"Quit";

    	begin
          
          if ( Quit.all = what.all )then           
             exit_op(0);
             return true;
          end if;

          return false;
 	end action;


other way

quit_button:	Button_Ptr:= new_Button(+"Quit");
.
.
.

	function action(Obj : access Button_Obj;
        		evt : Event_Ptr;
        		what : Object_Ptr)
			return boolean is
             
        begin
          if  evt.target = quit_button  then
 -- Problem: it doesn't exist such "=" operator between Object_Ptr
             exit_op(0);
             return true;
          end if;

          return false;
 	end action;








^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Mapping between Ada95 (AppletMagic from Intermetrics Inc) and Java
  1997-01-10  0:00 Mapping between Ada95 (AppletMagic from Intermetrics Inc) and Java FREBOURG Fabrice
@ 1997-01-11  0:00 ` Craig E. Ransom
  0 siblings, 0 replies; 2+ messages in thread
From: Craig E. Ransom @ 1997-01-11  0:00 UTC (permalink / raw)



<< I've a problem to execute an applet with Ada95. (cross-compilator 
AppletMagic)
I've created a quit button on a frame. When I'm clicking on such a 
button, I must 
normally trigger is its associate operation. This operation is called 
action. >>

I suggest going to Intermetrics home page (www.intermetrics.com, I 
believe) and posting your problem to their technical support area.

HTH

(I picked up a copy of AppletMagic at Tri-Ada but have been too busy to 
really explore it!)

-- Craig (The Data Ferret 8:>)
Janus/Ada 83; Janus/Ada 95; JAWS & CLAW; AppletMagic
Using Virtual Access 3.52 build 159c (32-bit) Win95






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-01-11  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-10  0:00 Mapping between Ada95 (AppletMagic from Intermetrics Inc) and Java FREBOURG Fabrice
1997-01-11  0:00 ` Craig E. Ransom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox