home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 28 / #28-1.iso / Pcpp / hints.sxt < prev    next >
Encoding:
Text File  |  1998-06-30  |  1.3 KB  |  38 lines

  1. // ok - I've included 2 methods by which you can list as many items as you want
  2. // the first is the listbox, the second is a html element
  3. // at the moment, the html element  is set to display, and the listbox is
  4. // off. to check the action of the listbox, set it and 'init_listbox'
  5. // element ON, and the html_listbox OFF
  6. // the nice thing about the html element is that its see-thru, unlike the
  7. // listbox
  8.  
  9. init_listbox:
  10.     // you can do this, or just fill in the selections in the element itself
  11.     h_listbox = get_element "list box 1"
  12.     h_listbox.choices = "item1\nitem2\nitem3"
  13.     display element h_listbox
  14.     
  15.  
  16. select_game:el_handle,el_message
  17.     switch el_message
  18.         case NOTIFY_SELECT
  19.             selected_game = el_handle.get(el_handle.selected_pos())
  20.             debug selected_game
  21.             
  22.             // now, if you're going to be updating this stuff often,
  23.             // you'd want a method of displaying the appropriate
  24.             // html element simply. I'd suggest you call the html
  25.             // element the same name (or a derivative of) the listbox
  26.             // item. eg. if your html element was called
  27.             // "html_item1" you could call the following:
  28.             
  29.             display element "html_" & selected_game
  30.             
  31.             break
  32.  
  33.  
  34. html_select_game:selected_game
  35.     debug selected_game
  36.     
  37.     // and this produces the same result as above
  38.     display element "html_item" & selected_game