Conditional Compilation

After gaining a lot more knowledge about XOJO (thanks mainly to this Forum either by asking or lurking) I have decided to use Xojo properly, i.e. do all my development on the Mac (which I prefer) ad create apps for both Mac and Windows.

I do have a small problem however with Container Controls. I have looked at Paul’s OK - Cancel button setup, but I seem to have a slightly different case.

I have a Container Control which contains various TextFields or Label and one Rectangle.

Because I an developing on the Mac, it looks fine. But on Windows, the Controls are nearly all out of place. Because, as far as I can see a Container Control doesn’t have an Open Event I don’t see how to use Conditional Compilation. And I am still in the dark how to do it using (say) the App or window OpenEvent.

Thanks in advance.

but Container controls DO have an OPEN event (you have to add it just like any other event)

it has KeyUp, LostFocus, All the mouse events, Moved, Open, Paint, Resized, etc…

then you use [quote]#if TargetWindows[/quote]

Thanks Dave for the quick reply.

This is my problem at the moment. I have probably only used AddEvent once, and it hasn’t sunk in yet. I will look it up again and see if I can get things working.

I am not sure where your confusion lies…

  • select the container you wish to add the events to
  • click on the [+] icon at the top of the window (it has a little down arrow next to it)
  • click on EVENT HANDLER
  • select the event you wish to add
  • repeat as necessary for additional events

I don’t think Resize fires.