>From the "Simple tutorial on bizObjects":

> class MainForm(dabo.ui.dForm):
>     def afterInit(self):
>         """Hierher gehört die UI-Definition
>         """
>         self.Sizer = vs = dabo.ui.dSizer('v')
>         custPanel = CustomerPanel(self)
>         vs.append(custPanel, 1, 'x')
>         vs.appendSpacer(8)
>         hs = dabo.ui.dSizer('h')
>         hs.append(dabo.ui.dButton(self, Caption="First", OnHit=self.first),
> 0) 
>         hs.append(dabo.ui.dButton(self, Caption="Next", OnHit=self.next), 0) 
>         hs.append(dabo.ui.dButton(self, Caption="Prior", OnHit=self.prior), 
0)
>         hs.append(dabo.ui.dButton(self, Caption="Last", OnHit=self.last), 0)
>         vs.append(hs)
>         vs.appendSpacer(8)
>         contPanel = ContactsPanel(self)
>         vs.append(contPanel, 2, 'x')
>         self.layout()
>         self.requery()
>
>     def first(self, evt):
>         self.super()
>
>     def next(self, evt):
>         self.super()
>
>     def prior(self, evt):
>         self.super()
>
>     def last(self, evt):
>         self.super()

>From the discussion about it on the list:

>  Author: Ed Leafe <ed AT leafe .DO.T com>
> Subject: Re: [dabo-users] [part 2] a Simple tutorial on bizObjects`
> Posted: 2007/12/31 22:49:40
>
> On Dec 31, 2007, at 8:53 PM, bsnipes wrote:
> > Where can I find info on the super() method? Does this call an a
> > method in
> > a base class?
>
> It's a somewhat magical shortcut Paul cooked up for calling the
> superclass behavior for a method. It's in dabo.lib.autosuper, and is
> one of the mixin classes for dObject. So if your class is Foo, and
> based on dabo.Bar, the following are all equivalent:
>
> def method(self):
> dabo.Bar.method(self)
>
> def method(self):
> super(dabo.Bar, self).method()
>
> def method(self):
> self.super()
>
> I prefer the second form, since it and the last work better with
> subclasses based on multiple inheritance, and the last form is just a
> little too fragile-feeling for me. However, it does seem to work
> well, so it's just a matter of taste.

First a little nit-picking: shouldn't the second form be 
"super(Foo, self).method()"?

Second: I know, having tried it, that those method definitions are necessary. 
Without them, only with "OnHit=self.first" etc., the buttons won't do 
anything. But why? They don't do anything but call the base class methods 
with the same name. I thought if a method is called on a class instance and 
not found in the class definition it's searched for in the base class(es) 
anyway. 

What did I overlook?

Thank you,
Sibylle 
 

-- 
Dr. Sibylle Koczian


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to