REBOL [ Title: "Check your e-mail" Author: "Arie van Wingerden" Email: rebolution@zonnet.nl Version: 1.1 Date: 27-Sep-2003 Type: 'script ] lay: layout [ style lab label 100 right style updatable-text-list text-list with [ update-slider: does [ sld/data: 0 sn: 0 sld/redrag lc / max 1 length? head lines ] ] across backcolor blue vh2 "Provide your e-mail account information" return lab "Userid" uid: field return lab "Password" pwd: field hide return lab "POP3 server" pop: field return lab button "Fetch e-mails" [ fill_list ] button "Clear fields" [ clear_fields ] return lab "E-mails" emails: updatable-text-list 600x200 return key keycode #"^m" [ fill_list ] ] popup: layout/offset [ across backcolor red errtxt0: text 500 return errtxt1: text 500 return errtxt2: text 500 return errtxt3: text 500 return button "OK" [ hide-popup ] return ] 200x200 fill_list: does [ clear emails/data count: 0 if error? err: try [ mails: read/lines to-url rejoin [ "pop://" uid/text ":" pwd/data "@" pop/text ] ] [ errdata: disarm err errtxt0/text: rejoin [ "code=" errdata/code " id=" errdata/id ] errtxt1/text: errdata/arg1 errtxt2/text: errdata/arg2 errtxt3/text: errdata/arg3 inform popup return ] focus uid foreach mail mails [ count: count + 1 msg: import-email mail append emails/data rejoin [ "===== mail #" count " =====" ] append emails/data rejoin [ "From : " msg/from ] append emails/data rejoin [ "Date : " msg/date ] append emails/data rejoin [ "Subject: " msg/subject ] ] if count = 0 [ append emails/data " --- no e-mails found ---" ] emails/update-slider show emails ] clear_fields: does [ clear-fields lay clear emails/data focus uid emails/update-slider show [ uid pwd pop emails ] ] focus uid view lay