Trying bind Mouse buttons with application

ITEM: RS4000014440



Question........:                                                               
                                                                                
I am using AIX V4.1.4 and trying to customize user written applicatons          
so that a menu (containing application name) pop-up by pressing                 
mouse button two (middle). I managed to edit my $HOME/.dt/dtwmrc file           
and define a menu entry which pops-up by pressing mouse button 2.               
However I am unable to execute these applicaton by clicking on them.            
My menu entry sample is below;                                                  
                                                                                
"Application Menu"         f.title ......                                       
"Application-A"            f.exec "ls -l"                                       
"Application-B"            f.exec "/tmp/myprog"                                 
"Applicaton-C"             f.exec "banner hello"                                
........                                                                        
Can you give me few tips on HOW TO make these application executed             
from the pop-up window.                                                         
Thanx                                                                           
Answer..........:                                                               
====> THIS TEXT HAS BEEN ENTERED BY IBM IN ITALY                                
Hallo,                                                                          
The problem is that AIX doesn't know where to exec the command.                 
I suggest you to start an aixterm an there execute the command                  
(Appl.C and Appl.D in the example) or to create an action that starts           
an aixterm and executes the command (Appl.B).                                   
                                                                                
Example:                                                                        
"Application Menu"                  f.title                                     
"Appl.A"                            f.exec "aixterm &"                          
"Appl.B"                            f.action aixterm                            
"Appl.C"                            f.exec "aixterm -e smitty &"               
"Appl.E"                            f.exec "aixterm -e ls-la &"                 
                                                                                
Note that Appl.E ends just after the end of the ls -la command ¢                
                                                                                
Regards                                                                         
Antonella Vanore                                                                
Question........:                                                               
OK. Thanx. I managed to get most of the things working.                         
However, I do not understand the f.action. In you example it                    
probably suppose to open an aixterm? if this is so, it tells me a               
missing action called aixterm. I think we need to define the f.action           
somewher as we do for f.menu. Am I right.                                       
Since CDE documentation are extremely weak, can you give a brief                
example for using f.action and how does it differ from f.exec.                  
Is there anyway to keep aixterm intact after Appl.E finishes                   
(in your example)                                                               
Also, why do we run all these commands in background.                           
Your guidance will be highly appreciated.                                       
Thanx                                                                           
Answer..........:                                                               
====> THIS TEXT HAS BEEN ENTERED BY IBM IN ITALY                                
Hallo,                                                                          
I apologize for the delay.                                                      
First of all, I'll try to explain you what an action is.                        
An action provides a general mechanism to invoke applications or                
procedures. In the most general case actions are represented as objects         
in the desktop so the user can start the application just by double             
clicking on it  iconic representation, in say, File Manager.                    
An easy way to way to create an action is to use the CreateAction Tool          
(Application Manager - DesktopTools folder).                                   
You have to enter the name you want to give to your action (in my               
previous example : aixterm ), choose an icon, enter the command that            
your                                                                            
action will execute when it is double clicked (for example                      
aixterm -fn rom20.iso1 ).                                                       
After saved, the action file will be created and placed in your home            
directory and the definition file will be created and placed in                 
$HOME/.dt/types.                                                                
You will find the icon representing the action in your Home Folder              
and you can place it in the Front Panel. It will start just double              
clicking on it (you can use actions instead of menu ¢ ).                        
                                                                                
Aixterm ALWAYS ends after it has finished executing the command.                
If you want to see the output of the command , in say ls -la,                   
you can use an action , enter the command ls -la, and select in                
the Window Type (in the bottom of CreateAction window):                         
Terminal (Manual Close).                                                        
In this way the window will remain open until you close it, you can             
see the output of the command, but you haven't the prompt.                      
                                                                                
No problems about the backgroud you can ignore it.                              
                                                                                
I hope having clearified about action ¢                                         
                                                                                
Regards                                                                         
Antonella Vanore                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RS4000014440 ITEM: RS4000014440
Dated: 01/1997 Category: AIXGRAPH
This HTML file was generated 99/06/24~12:43:05
Comments or suggestions? Contact us