From: Hal Fulton Date: 2004-04-08T16:40:32+09:00 Subject: Re: Idea: Simplified GTK Gregory Millam wrote: > Received: Thu, 8 Apr 2004 15:18:53 +0900 > And lo, Hal wrote: > > >>Maybe we could allow both. I'm a believer (though some are not) in a >>little "magic" parameter handling. >> >>In other words, we could code it so as to permit calling it either way. > > This is, of course, doable, but I don't think this kind of "overloading" > would be easily readable or understandable when learning ezgtk. To me, it's like gsub with/without a block, ranges or regexes in String#[], and so on. TMTOWTDI. I don't wish to be unreasonable or be "not a team player" -- assuming we actually do anything with this -- but if it doesn't at least *permit* coding in some style that I like, then my motivation to help work on it is diminished. > I'm more > in favor of shortcuts like: > > button { > label "foo" > onclick {...} > } The Tk-ish look. That's ok for complex cases. > button_onclick "foo" { > ... > } Hmm, I disapprove. It's like making a name out of what should be a name and some kind of qualifier. > Maybe an easier name like: > > ezbutton "foo" { > ... > } Why would ezbutton be better than button here? I'm still leaning toward writing it in such a way that we can each choose our styles. To reiterate, I'd like the simplest case to look like this: @b1 = button "Label" { call_me } with the possibility of modifying a created widget: @b1.setup do border 10 blah blah whatever 123 on_enter { do_this } end though I'm not picky about the name "setup" -- I considered others such as: do, change, modify, etc. And I do think it's reasonable to allow the other form also: button do label "Label" this "that" on_click { do_something } blah foo end But let's talk... only trouble is I'm very tired right now, as it's 2:40 am here. Cheers, Hal