I am working with the Pycon Tutorial (section: Customising and AppWizard
Application).
When I try to add CklCategories to PagEditRecipes.py, the final picture is
different from what I can see in the Tutorial.
I cannot find out why my from doesn't look like it should be.
I did not understand where and how to insert CklCategories in the form.
Here is the code of PagEditRecipes py and the screenshot of the form:
Could somebody advise what went wrong?
*****
# -*- coding: utf-8 -*-
import dabo
if __name__ == "__main__":
dabo.ui.loadUI("wx")
from PagEditBase import PagEditBase
from CklCategories import CklCategories
class PagEditRecipes(PagEditBase):
def createItems(self):
"""Called by the datanav framework, when it is time
to create the controls."""
mainSizer = self.Sizer = dabo.ui.dSizer("h")
gs = dabo.ui.dGridSizer(VGap=7, HGap=5, MaxCols=3)
## Field recipes.title
label = self.addObject(dabo.ui.dLabel,
NameBase="lbltitle",
Caption="title")
objectRef = self.addObject(dabo.ui.dTextBox,
NameBase="title",
DataSource="recipes",
DataField="title")
gs.append(label, alignment=("top", "right") )
gs.append(objectRef, "expand")
gs.append( (25, 1) )
## Field recipes.subtitle
label = self.addObject(dabo.ui.dLabel,
NameBase="lblsubtitle",
Caption="subtitle")
objectRef = self.addObject(dabo.ui.dEditBox,
NameBase="subtitle",
DataSource="recipes",
DataField="subtitle")
gs.append(label, alignment=("top", "right") )
currRow = gs.findFirstEmptyCell()[0]
gs.setRowExpand(True, currRow)
gs.append(objectRef, "expand")
gs.append( (25, 1) )
## Field recipes.ingred
label = self.addObject(dabo.ui.dLabel,
NameBase="lblingred",
Caption="ingred")
objectRef = self.addObject(dabo.ui.dEditBox,
NameBase="ingred",
DataSource="recipes",
DataField="ingred")
gs.append(label, alignment=("top", "right") )
currRow = gs.findFirstEmptyCell()[0]
gs.setRowExpand(True, currRow)
gs.append(objectRef, "expand")
gs.append( (25, 1) )
## Field recipes.proced
label = self.addObject(dabo.ui.dLabel,
NameBase="lblproced",
Caption="proced")
objectRef = self.addObject(dabo.ui.dEditBox,
NameBase="proced",
DataSource="recipes",
DataField="proced")
gs.append(label, alignment=("top", "right") )
currRow = gs.findFirstEmptyCell()[0]
gs.setRowExpand(True, currRow)
gs.append(objectRef, "expand")
gs.append( (25, 1) )
## Field recipes.date
label = self.addObject(dabo.ui.dLabel,
NameBase="lbldate",
Caption="date")
objectRef = self.addObject(dabo.ui.dTextBox,
NameBase="date",
DataSource="recipes",
DataField="date")
gs.append(label, alignment=("top", "right") )
gs.append(objectRef, "expand")
gs.append( (25, 1) )
## Field recipes.image
label = self.addObject(dabo.ui.dLabel,
NameBase="lblimage",
Caption="image")
objectRef = self.addObject(dabo.ui.dTextBox,
NameBase="image",
DataSource="recipes",
DataField="image")
gs.append(label, alignment=("top", "right") )
gs.append(objectRef, "expand")
gs.append( (25, 1) )
gs.setColExpand(True, 1)
mainSizer.insert(0, gs, "expand", 1, border=20)
# Add top and bottom margins
mainSizer.insert( 0, (-1, 10), 0)
mainSizer.append( (-1, 20), 0)
self.Sizer.layout()
self.itemsCreated = True
self.super()
mainSizer.insert(0, gs, 1, "expand", border=20,
borderSides=("top", "bottom", "left"))
vsRight = dabo.ui.dSizer("v")
mainSizer.append(vsRight, "expand", border=20,
borderSides=("top", "bottom", "right"))
vsRight.append(CklCategories(self), 1, "expand")
self.Sizer.layout()
self.itemsCreated = True
self.super()
if __name__ == "__main__":
from FrmRecipes import FrmRecipes
app = dabo.dApp(MainFormClass=None)
app.setup()
class TestForm(FrmRecipes):
def afterInit(self): pass
frm = TestForm(Caption="Test Of PagEditRecipes", Testing=True)
test = frm.addObject(PagEditRecipes)
test.createItems()
frm.Sizer.append1x(test)
frm.show()
app.start()
**************
Miklós Martinecz
--- StripMime Report -- processed MIME parts ---
multipart/related
multipart/alternative
text/plain (text body -- kept)
text/html
application/octet-stream
---
_______________________________________________
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/!~!uenerkvcmdkaaqacaaaaaaaaaaaaaaaaabgaaaaaaaaackgpanngp0urgxvyyklpm8kaaaaqaaaajjbocsxb3ucvc8i617t31geaa...@upcmail.hu