From: Duncan C. <dun...@wo...> - 2005-03-05 16:46:18
|
All, I've not started committing properties yet because I'm not sure about naming conventions. At the moment the names are things like "label" which will obviously clash with the same properties from other modules. We can do three things as far as I can see: 1. leave them ambiguous in which case users will have to say Gtk.UI.Graphics.Gtk.Buttons.Button.label or do qualified imports. It had been or intention not to really make users have to know the internal structure of the library in particular the categories (Buttons, Abstract, etc) 2. use name prefixes like we do for method names, eg "buttonLabel" instead of just "label". So that'd mean saying: set button [ buttonLabel := "bla bla" ] 3. use classes. This is what wxHaskell and hs-fltk do. Eg they have a class Textual w where text :: Attr w String and then the various object types are members of that class. Opinions? I'm not terribly in favour of the classes approach I think it makes it hard for users to understand and makes it hard to document. It's a real shame it's not easier to import qualified modules en-mass, eg: import Graphics.UI.Gtk.* and then reference Button.label Duncan |