Re: [Gambas-user] Documentation: Events not firing in dynamically instantiated forms.
Brought to you by:
gambas
|
From: Benoît M. <ga...@us...> - 2014-11-27 23:52:29
|
Le 28/11/2014 00:27, T Lee Davidson a écrit : > On 11/27/2014 04:02 PM, Tobias Boege wrote: >> Hmm, comp/gb.qt4/form already says the entire truth -- if you know what all >> the words mean. > > All comp/gb.qt4/form says about events is: > === > Event management > > By default, a form is its own event observer. > > It means that all the events raised by the Form object are caught by > event handlers defined in the form source code. > === > > It does not say anything about the change in event observer when > instantiating a form AS FormWhatever. So, to me, not the entire truth. > > >> I must admit that I don't really care: I think I understand what happens to >> a good extent and if someone asks the question again, I can pull of the >> explanation again (or more likely I'll link to this thread). > > Rhetorically, wouldn't it be nice, though, if someone didn't *have* to ask? > > >> If everything was in the docs, what fun would there be in learning [ being >> able to discover things on your own over time ] ?;-) It's at least what I >> enjoy most. > > Lol. Yes, discovering and learning can be fun. > > But, I think it is more fun to learn how to do something with the tools > at hand than having to learn the special nuances of any particular tool. > > As a farmer, I sometimes have to make a tool to get the job done. Do I > enjoy that? Well, I enjoy making things. But I do not enjoy feeling > robbed of my productive time. > > Not knowing that instantiating a form As FormWhatever overrides the > default event handler could be a "gotcha" for someone who is not as > knowledgeable as you, as Stephen found out. > > And, "As Name" is a feature of the Gambas language implementation. So, > in my opinion, the appropriate venue for documenting this behavior would > not be in a GambasMag article. > > But, whatever. I was just looking to try to make things better for others. > > I have updated the 'Gambas object model' description on the wiki to clarify the special behaviour of the Form objects. http://gambaswiki.org/wiki/doc/object-model If you haven't read that document yet, I strongly suggest that you read it and tell me if the explanations are clear enough for you. Regards, -- Benoît Minisini |