Conditional Display : Différence entre versions

De Wiki
Aller à : navigation, rechercher
Ligne 1 : Ligne 1 :
 
Conditional display is simply managed with « <font color=#FF8C00>if</font> » or « <font color=#FF8C00>switch</font> » and using the <font color=#4169E1>generic()</font> method (or the <font color=#4169E1>display()</font> method for specific treatments):
 
Conditional display is simply managed with « <font color=#FF8C00>if</font> » or « <font color=#FF8C00>switch</font> » and using the <font color=#4169E1>generic()</font> method (or the <font color=#4169E1>display()</font> method for specific treatments):
 +
 +
<syntaxhighlight lang="python" line='line'>
 +
def quickSort(arr):
 +
less = []
 +
pivotList = []
 +
more = []
 +
if len(arr) <= 1:
 +
return arr
 +
else:
 +
pass
 +
</syntaxhighlight>
 +
  
 
<syntaxhighlight lang="java">
 
<syntaxhighlight lang="java">

Version du 3 mai 2017 à 11:54

Conditional display is simply managed with « if » or « switch » and using the generic() method (or the display() method for specific treatments):

  1. def quickSort(arr):
  2. 	less = []
  3. 	pivotList = []
  4. 	more = []
  5. 	if len(arr) <= 1:
  6. 		return arr
  7. 	else:
  8. 		pass


public class myPanel extends GPanel {
 
  GButton but1;
  GButton but2;
  GButton but3;
  GCheckBox cb;
 
  public myPanel() {
    but1 = new GButton("Bouton 1");
    but2 = new GButton("Bouton 2");
    but3 = new GButton("Bouton 3");
    cb   = new GCheckBox("Display button 3"); 
  }
 
  public void generic() throws GException {
    put(but1);
    put(but2);
    if ( cb.isSelected() ) { put(but3); } // Easy, isn't it ?
    put(cb);
   }


ConditionalDisplay1.jpg ConditionalDisplay2.jpg


Return to the introduction ↑ Go to the next page →