Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 5f5d88c6b2988e78ee210e72f14d11ca > files > 831

python-card-0.8.1-9mdv2010.0.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
                           
  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
                           
  <meta name="author" content="Dan Shafer">
  <title>Single Choice Dialog</title>
    
</head>
  <body>
             
<h1>Single Choice Dialog</h1>
       <img src="images/dialogsfig3.png"
 alt="Single Choice Dialog Sample" width="200" height="176">
        <br>
       <br>
             
<h2>Creating the Dialog</h2>
       Create a Multiple Choice Dialog by calling dialog.multipleChoiceDialog 
  with  the arguments shown in the following table.<br>
       <br>
             
<table cellpadding="2" cellspacing="2" border="1" width="50%">
         <tbody>
           <tr>
              <td valign="top"><b>Argument</b><br>
             </td>
             <td valign="top"><b>Data type/notes</b><br>
             </td>
           </tr>
           <tr>
             <td valign="top">self<br>
              </td>
             <td valign="top">the window (background) that is the parent
for   the  dialog<br>
             </td>
           </tr>
           <tr>
             <td valign="top">message<br>
             </td>
             <td valign="top">quoted string displayed inside dialog box as
 prompt   for user input<br>
             </td>
           </tr>
           <tr>
             <td valign="top">title<br>
             </td>
             <td valign="top">quoted string displayed in title bar of dialog<br>
              </td>
           </tr>
            <tr>
             <td valign="top">lst<br>
             </td>
             <td valign="top">list of values representing contents of dialog
  choice  list<br>
             </td>
           </tr>
                           
  </tbody>       
</table>
        <br>
       <b>Example:<br>
       <br>
       </b>Above dialog was created with this line of code:<br>
       <br>
      <code> result = dialog.singleChoiceDialog(self, "message", "title", 
['one',   'two', 'three'])<br>
      </code> <br>
              
<h2>Interacting With the Dialog</h2>
       The singleChoiceDialog component returns two values, stored as elements 
   of the Python dictionary called "results" returned by all PythonCard dialogs. 
   These results are as shown in the following table.<br>
       <br>
             
<table cellpadding="2" cellspacing="2" border="1" width="50%">
         <tbody>
           <tr>
             <td valign="top"><b>Name of value</b><br>
              </td>
             <td valign="top"><b>Description</b><br>
             </td>
           </tr>
           <tr>
             <td valign="top">accepted<br>
             </td>
             <td valign="top">True = user clicked OK<br>
        False = user clicked Cancel<br>
             </td>
           </tr>
           <tr>
             <td valign="top">selection<br>
             </td>
             <td valign="top">string containing the list element  selected
 by  the user<br>
              </td>
           </tr>
                           
  </tbody>       
</table>
       <br>
      <b>Example:<br>
      <br>
   </b>   The sample dialog shown at the top of this page returns the following 
 results:<b><br>
      <br>
      </b>accepted: True<br>
       selection: three<br>
      <br>
      <br>
       &nbsp; <br>
       <br>
       <br>
         <br>
     <br>
   
</body>
</html>