Hemme's Blog

Stories from behind the keyboard

  • RSS
  • Twitter
  • Linkedin

ScriptCS-GUI has evolved a little bit. At the moment the following helpers are declared inside the static class Gui.

  • Gui.OpenFileDialog(): open a classic Open File Dialog and return the path of the selected file.
  • Gui.SaveFileDialog(): act similar to OpenFileDialog()...
  • Gui.PopUp(): open a pop-up and returns a form object. You can use its Sta.Enqueue(action) method to inject code in the form's main thread (e.g. to add controls at runtime) while working inside the console!
  • Gui.Drawing(): open a drawing form and returns the Graphics object you can use to draw on the form (the console stays responsive in this case too!)

Probably the most useful thing is that I've managed to open Windows Forms from the console while leaving the console "alive responsive" (tipically the console would (in-)act like a zombie after any Application.Run() over the form!). This means that now you can go on using the ScriptCS console and send any command to any window you created FROM the console. This was not obvious and I've got lots of ideas about how to implement ScriptCS-GUI further! - Stay tuned :)

I'm going to write more about these in my next post. For now you can just launch the interactive script "gui-demo.csx", run it and - *hopefully* - send me some feedback :)

The interactive script "gui-demo.csx" lets you play with classic Windows Forms while the console stays responsive!

No comments: