On 5/3/13 4:28 PM, John Fabiani wrote:
>
> if __name__ == "__main__":
> app = dabo.dApp()
> app.Icon = "pes.ico"
> app.BasePrefKey = "PesED"
> app.setAppInfo("appName", "PES Education")
> app.setAppInfo("appShortName", "PES Education") ## appShortName
> normally just removes all the spaces from appName
> app.setAppInfo("Icon", "pes.ico")
> app.AboutFormClass = PesAbout
> app.MainFormClass = MainForm
> app.start()
>
> I've been using the above basic code from the start. I'm I doing it wrong?
This is fine. Before, you said:
> In the past writing a save method in the app.MainFormClass ( in this case
> "MainForm")
> still executed the save method in the parent (dabo.ui.Form) without having to
> do a
> super(). At least I have code the worked that way in 0.9.5.
I thought from the context that you had a dForm as a Parent of a dMainForm. I
see now
that you didn't really mean "Parent" but rather "superclass". And I think you
are
referring to the situation, which defines two subclasses for clarity (so I
don't have
to say "in dabo.ui.dForm"):
class MySuperForm(dabo.ui.dForm):
def save(self):
print "MySuperForm.save()"
class MyForm(MySuperForm):
def save(self):
print "MyForm.save()"
Do I have it right now? If so, then this example:
frm = MyForm(None):
frm.save()
Would result in:
MyForm.save()
You'd have to add the super(), like:
class MyForm(MySuperForm):
def save(self):
print "MyForm.save()"
super(MyForm, self).save()
to get:
MyForm.save()
MySuperForm.save()
And in the case of MyForm not overriding save() at all, if you called
MyForm.save()
you'd see:
MySuperForm.save()
This has always been this way. It's how Python works.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]