---------------------- MENSAGEM ORIGINAL ----------------------
On Thursday 31 August 2006 09:30, Ed Leafe wrote:
On Aug 31, 2006, at 12:08 PM, Miguel Lopes wrote:
def main():
app = dabo.dApp()
app.MainFormClass = MainForm
app.start()
##
Can you give me some pointers on how to properly use
dabo.ui.createForm(frmclass, show=False) and also
dabo.ui.dForm.addObject("path/to/.cdxml/file")
It's even easier than that. All you need to do is:
app.MainFormClass = "frmMain.cdxml"
Dabo will recognize that as a Class Designer form class, and use it
directly, just as it uses form classes defined in Python code.
You would use createForm() and addObject() just as you would with
classes defined in Python code instead of .cdxml files. Let's say
that you have a search form that you want to bring up when the user
clicks a button. If you defined that form in Python code and named it
'MySearchForm', you'd write: dabo.ui.createForm(MyFormClass). If you
created your search form in the Class Designer and saved it in a file
named 'searchForm.cdxml', you'd write: dabo.ui.createForm
("searchForm.cdxml"). Dabo understands both, and will in both cases
instantiate the form from the class definition.
The same holds true for addObject(). If you want to add a custom
control to your form, and you have it defined in Python code as
'MyCustomControl', you'd write: self.addObject(MyCustomControl). If
you had defined the control in the Class Designer and saved it in
'customControl.cdxml', you'd write: self.addObject
("customControl.cdxml"). Again, in both cases, Dabo would create the
control and add it to the object referenced by 'self'.
What I managed to understand about these methods doesn't seem to be
enough for me to make it work.
You did the smart thing by posting a question, then. Turns out that
you were working too hard! We try to make things as simple as
possible with Dabo.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
Ed,
If memory serves that question has been asked in the past (more than once). I
wonder if you could add your response to the "how to" section... I believe
it is required understanding to working with dabo.
John
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
John and Ed,
I volunteer myself to make a small tutorial with the stuff I'm learning about
using .cdxml files. Since I'm putting together a very small app to learn about
Dabo I can use it as an example tutorial. I would only request that someone
more knowledgeable reads it before it goes on-line.
Best,
Miguel
O Clix quebrou mais uma barreira!
ADSL até 20 Mb + Telefone livre de assinatura por apenas 34,9/mês
Acabe de vez com os 15 da assinatura telefónica!
Saiba mais em http://acesso.clix.pt
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users