[cells-gtk-devel] setting parent

ktilton at nyc.rr.com ktilton at nyc.rr.com
Thu Feb 17 14:47:51 UTC 2005



----- Original Message -----
From: Peter Denno <peter.denno at nist.gov>
Date: Wednesday, February 16, 2005 6:06 pm
Subject: Re: [cells-gtk-devel] setting parent

> On Wednesday 16 February 2005 10:43, ktilton at nyc.rr.com wrote:
> 
> > Two possible tricks. First, always make kids a rule: (c? ....)
> 
> Do you really mean "always" here? I haven't done it before. I 
> don't see it 
> used in Vasilis's demo either.

No, I did not mean it. That happens to be my policy for reasons I cannot explain in this quick response before heading out, but you are right, it is not always required.

> 
> >
> > If you make the pop-up a c? rule, you always have "self" to link 
> you into 
> the hierarchy:
> >    :pop-up (c? (make-menu :owner self....))
> >
> > Note that self would be the event-box in this context, and that 
> I just
> > invented the owner slot (tho I usually use "owner" in cases like 
> this,> which I have encountered before.
> 
> This worked, thanks.  Is self being bound to the containing mk-
> <widget> 
> something we can count on?

Yes. C? has the incidental quality of not running until just after instance-initialization. Without the c?, as you know, the form after the initarg gets evaluated very early, so the value can be passed to make-instance. With c?, you can supply an initialization form which is aware of the instance being made. I think expanding or examining the macro c? will be helpful.

> 
> >
> > > I actually have another example where the strict 1-1 mapping
> > > between widget
> > > hierarchy and kids hierarchy doesn't work: user-specified stock
> > > icons. But I
> > > think I have a solution to that one. (clos object aren't really
> > > needed here,
> > > but getting the stock icons defined before the model build happens
> > > has been a
> > > challenge.).
> >
> > We can look at that, too, if you give me more specifics. Mind 
> you, to a
> > degree we have to blind-lead-blind since I do not know Gtk. But 
> I reckon we
> > can muddle thru.
> 
> This turns out to be something that can, and probably should be, 
> done without 
> using the clos objects, it is all gtk calls. I added an 
> initialize-instance :after method to gtk-app that you can see in 
> the cvs 
> repository, cells-gtk/gtk-app.lisp.

OK, I will be back home late tonight, but the black hole commercial Lisp opportunity is really accelerating. I will do my damndest to keep any cells-gtk user going until I can get you some proper doc, but it may be hit or miss.

cheers, kenny





More information about the cells-gtk-devel mailing list