Received: Thu, 8 Apr 2004 16:40:32 +0900
And lo, Hal wrote:

> To me, it's like gsub with/without a block, ranges or regexes
> in String#[], and so on. TMTOWTDI.

Those are with or without blocks. What I'm arguing here is that it acts differently depending on wether or not a string argument is also passed. And that determines if the block is called now or on an event.

What if someone tried:

button "foo" {
  on_click { ... }
  on_mouseover { ... }
}

> 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 think we all feel that way - only problem is we all like different styles, and there's no one, 'obvious' way.
 
> > Maybe an easier name like:
> > 
> > button_onclick or
> > ezbutton "foo" {
> >   ...
> > }
> 
> Why would ezbutton be better than button here?

Because of the reason I gave above - I'm trying to differentiate between blocks executed now or later.

> 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.

If EzGtk functions return Gtk objects, this isn't really doable without either modifying Gtk classes or making a host of EzGtk.

On the other hand ... I remember some sort of thread a long while back regarding changing contexts - can't remember if anything came of it. But if it was easily implemented, it'd allow us to modify the gtk widgets in their own context.

vb = vbox {...}
vb.in_context do
  set_width 100   # Gtk here, not EzGtk
  set_color "red" # shortcut for vb.set_color
end

4:26 am here. But then, I woke up at midnight.

- Greg Millam