Page 1 of 1

Using the Object Explorer

PostPosted: Tue Feb 02, 2010 9:27 pm
by torial
I was wondering if someone could give me some tips on how to use the object explorer. First, I guess, I'm assuming that it is something that is external to my code, so I don't have to make changes to it, but at worst compile it in. Is this assumption correct?

Here's the command switch I tried:
Code: Select all
cobra -ref:System.Windows.Forms -ref:System.Drawing  ObjectExplorer-WinForms.cobra "$(FilePath)"


Re: Using the Object Explorer

PostPosted: Wed Feb 03, 2010 12:19 am
by Charles
Yes, you have to compile it in (or compile it into a DLL and reference that).

You also have to augment your program to create it. You might do this anywhere in your program, possibly as part of an if-statement or the target of a button if your program itself has a GUI.

Or you might create it at the end of your .main.

See CobraMain-ObjectExplorer-WinForms.cobra for an example.

Here is a simpler example:
form = ObjectExplorer()
form.text = 'My WinForms Object Explorer'
form.addKeyValue('a list', [1, 2, 3])
form.addKeyValue('a set', {'a', 'b', 'c'})

Let me know if that works for you.