#790 Control Positioning...

baeltazor Fri 16 Oct 2009

hello,

there's a few things i haven't been able to wrap my head around.. one of them is How does Fan know where to position controls in a Window?

...Take the fwt's "demo.fan" sample code for example - i can't see any Location or Positioning code for any of the controls, so how did they all end up positioned where they are? Magic? Or does Fan read our thoughts...? :p

KevinKelley Fri 16 Oct 2009

Generally a widget or control is positioned by its parent. There are various kinds of Pane, like EdgePane, SashPane, ScrollPane, etc. A Pane overrides onLayout to put its child widgets where it wants them, using bounds or pos / size.

So you compose an interface by putting panes and widgets inside other panes, until you get the effect you want. If you want a different positioning scheme than the FWT classes provide, make your own by overriding the onLayout.

baeltazor Fri 16 Oct 2009

wow, thanks, that was helpful! :) i don't suppose you know how to get rid of (or hide) the msdos window programmatically would you?

KevinKelley Fri 16 Oct 2009

Yes.

baeltazor Sat 17 Oct 2009

Would you care to share it with me? :D.. I read your reply in the other Topic, but i'm really trying to avoid having to use batch files and repeat the same process all over again each time i need to run a fan app

KevinKelley Sat 17 Oct 2009

You're asking for something that's simpler than a one-line batch file? I could come over to your house and push the buttons for you I guess. <g>

There is no "one-click experience" to turn a Fan app into a windows executable; at least not yet. There are options, with varying degrees of difficulty, depending on what you want to do.

baeltazor Sat 17 Oct 2009

I like sarcasm. However, all I am trying to do is be able to run my FWT applications without showing the ms-dos window, and without having to create a batch file.

KevinKelley Sat 17 Oct 2009

Sorry for the snarkiness. I think you're right about this: FWT apps ought to be able to run without a console, when the app doesn't need the in and out streams.

baeltazor Sat 17 Oct 2009

no probs :-)

Login or Signup to reply.