If you're already used to C++ Qt and PyQt, qtHaskell should be relatively straightforward (though probably with a few gotchas). You could download qtHaskell and look at the examples to get an idea for the feel of it. If you're already used to Qt they should look familiar. Subclassing _is_ done a little weird: First you declare a dummy datatype: data MyQPushButton = MyQPushButton And then you use the qSubClass function: myQPushButton :: String -> IO (QPushButton MyQPushButton) myQPushButton s = qSubClass $ qPushButton1 s The type signature here is necessary. It's the only thing that forces the new (QPushButton a) to be a QPushButton MyQPushButton. Then you can use your subclassed buttons like so: main :: IO () main = do app <- qApplication dialog <- qDialog button1 <- myQPushButton "Click for Stuff" qObject_connectSlot1 button1 "clicked()" button1 "click()" $ on_pbutton_clicked dialog mainLayout <- qVBoxLayout qLayout_addWidget mainLayout button1 qWidget_setLayout dialog mainLayout qWidget_setWindowTitle dialog "Stuff Test" ok <- qDialog_exec dialog return() on_pbutton_clicked :: QDialog () -> QPushButton MyQPushButton -> IO () on_pbutton_clicked _dlg _this = do mb <- qMessageBox1 _dlg qMessageBox_setText mb $ "Stuff" qWidget_show mb return () Hmmm, though it doesn't look like you can currently overload methods of your parent class, usually you don't need too though as you can just tie into a signal (so you still can do things like paint). Though I'm kinda suprised I didn't notice this before, I'll have to email the guy and see if this is actually an issue. Also, qtHaskell doesn't fully support all the Qt widgets (though it covers most of them) but there is a new version coming out soon that should be more complete. Overall qtHaskell has served my perposes well. There is also a good listing of GUI toolkits for Haskell at - Job On Tue, Sep 1, 2009 at 1:49 AM, Michael Mossey <mpm at alumni.caltech.edu>wrote: > Thanks for the info. Interesting. I'm already familiar with C++ Qt and also > PyQt. I am also a fan of Qt. > > However, as a beginner to Haskell, I want to be sure I don't get myself > into trouble. I hope that qtHaskell is straightforward. > > Qt depends on deriving user classes. How is this handled in qtHaskell? > > Thanks, > > -Mike > > > Job Vranish wrote: > >> I recommend qtHaskell. >> I am a big fan of Qt in general. It has good documentation and extensive >> examples, is very well designed, and has a good license. I'd even say the >> C++ version is good choice for beginners (certainly easier to understand/use >> than say GTK). >> The qtHaskell bindings are also pretty good. The documentation and >> examples are not as extensive, but you can usually use the C++ documentation >> to fill in the gaps. >> Being already familiar with C++ Qt, using qtHaskell was a snap. However, >> if you're unfamiliar with both Qt and Haskell it will probably be confusing >> at first. Though I'd bet money the GTK bindings aren't any better in that >> regard. >> I'd still say you'd be more productive with qtHaskell in the long run. >> >> - Job >> >> >> On Sat, Aug 29, 2009 at 11:03 AM, Michael Mossey <mpm at alumni.caltech.edu<mailto: >>> >> >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: