After playing around with MonoMac I realized most people I know are running windows, most of the time thats fine. But sometimes I'd like to show something off and Qyoto seems like it could be the perfect cross platform solution!
Warning, before I go on. I'm quite new to F# and Qt so if theres any errors give me a yell below
I got a bit stuck going through the whole process of setting everything up, so here's what I did for anyone else looking to play with it.
The mono packages for OS X are 32bit, where as the Qt libraries from homebrew are 64bit. So based on adamv's homebrew alt repo I made a mono3 recipe at aktowns/tappedbrews to install simply tap it and brew install.
brew tap aktowns/tappedbrews brew install aktowns/tappedbrews/mono3
If anyone knows how to imply --HEAD using
depends_on in a recipe please tell me!
These homebrew recipes are mostly based off the instructions here with a few minor changes.
brew install qt brew install aktowns/tappedbrews/smokegen --HEAD brew install aktowns/tappedbrews/smokeqt --HEAD brew install aktowns/tappedbrews/qyoto --HEAD
Instead of compiling monodevelop, gtk# and numerous other dependencies its probably a lot easier to just grab the monodevelop binaries, install them and install mono 2.10.9 (to run monodevelop in) and select your default runtime as our brew compiled mono.
I noticed a bug with monodevelop (at least on 22.214.171.124) where if you have the binary 3.0.0 and your brew compiled 3.0.0 monodevelop wont let you set the default (it keeps defaulting to the binary 3.0.0) so for now 2.10.9 is fine.
Now lets create a new F# console project!
Adapted from zetcode's c# qyoto introduction
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44:
module Program open System open Qyoto let SIGNAL = QWidget.SIGNAL let SLOT = QWidget.SLOT type QyotoApp() as self = class inherit QWidget() do base.WindowTitle <- "Hello World!" base.ToolTip <- "Goodbye World" self.setupButton self.resizeAndCenter 250 150 base.Show() member self.resizeAndCenter w h = let qdw = new QDesktopWidget() let x = (qdw.Width - w) / 2 let y = (qdw.Height - h) / 2 base.Resize(w, h) base.Move(x, y) member self.setupButton : unit = let quit = new QPushButton("Quit", self) self.Connect(quit, SIGNAL("clicked()"), SLOT("quit()")) |> ignore quit.SetGeometry(50, 40, 80, 30) // MARK: Slots [<Q_SLOT("quit()")>] member self.quit() : unit = Environment.Exit(0) end let main(args) : unit = let application = new QApplication(args) let qyotoApp = new QyotoApp() QApplication.Exec() |> ignore main(Environment.GetCommandLineArgs())