FolderBrowser

MessageBox




WPF Tutorial Contents

APL  Home Page


FolderBrowser


Direct from System.Windows.Forms...

  ∇ z←SelectFolder w;⎕IO;⎕ML;⎕USING;f;result
   ⍝ Browse for a folder
      ⎕IO ⎕ML←0 3
      ⎕USING←,⊂'System.Windows.Forms,System.Windows.Forms.dll'
      f←⎕NEW FolderBrowserDialog''
      f.SelectedPath←w
      result←⍕f.ShowDialog ⍬
      :If 'OK'≡result
          z←f.SelectedPath
      :Else
          z←⍬
      :EndIf
    ∇


Hence...

  #.UTIL.DIALOGUE.SelectFolder 'd:\dick\temp'

MessageBox 

This stuff seems to work on the principle that if there's a consistent way to do it, or something more direct that violates the rules of logic the latter always wins.  So, the answer is simpler than the fastidious might assume - no creating objects or anything like that, just show a MessageBox...

   ⎕using←#.WPF.Using         ⍝ Could be simpler, if I could be bothered...
   'Yes'≡⍕MessageBox.Show 'Does this make sense?' 'Only Asking'  MessageBoxButton.YesNo
0

Note once again how nerdworld can't be satisfied with giving us a straightforward boolean or character result - we have to force a "32 bits pointer" into something useable.

Notice also how the argument order is different from APL/W's old ⎕WC defaults.

More complex examples (more buttons) to follow...