Thank you very much.

I tried that background attribute and it's ok. The setPosition one which I tried, it's not working. I know I may put it in the wrong position but because the form is using vizdlg. I see that link function and it can only link it to leftcenter of the whole picture. And actually only part of the table can be seen in the screen by that link function. I still cannot put it on the leftupper corner of the screen so that I can see the entire table in the screen. I just put my code here. Could you please tell me where I should put it?
In addition, the textbox is still not transparent though the table background is. Is is possible also make the textbox transparent? Since I tried that background which textbox doesn't have, could you please also tell me how I can do this?
Thank you.
Here is my code.
Code:
#######################form starts here
import viz
viz.go()
import vizdlg
class MyForm(vizdlg.Dialog):
def __init__(self,**kw):
#Initialize base class
vizdlg.Dialog.__init__(self,**kw)
(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=0)
# #Add row to dialog content section
#Add a subgroup containing slider/textbox
group0 = vizdlg.Panel(background=False)
#Add row for textbox to subgroup
row = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=6)
row.addItem(viz.addText('Character No.'))
self.textbox0 = row.addItem(viz.addTextbox())
group0.addItem(row)
#Add group to dialog content section
self.content.addItem(group0)
#Add a new subgroup containing other textboxes ( coded by me )
# group1 = vizdlg.Panel()
#Add row for textboxes
row1 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row1.addItem(viz.addText('Surname'))
self.textbox1 = row1.addItem(viz.addTextbox())
self.content.addItem(row1)
row2 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row2.addItem(viz.addText('Given name'))
self.textbox2 = row2.addItem(viz.addTextbox())
self.content.addItem(row2)
row3 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row3.addItem(viz.addText('Sex'))
self.textbox3 = row3.addItem(viz.addTextbox())
self.content.addItem(row3)
#Add a new row
row4 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row4.addItem(viz.addText('Date of Birth'))
self.textbox4 = row4.addItem(viz.addTextbox())
self.content.addItem(row4)
row5 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row5.addItem(viz.addText('Country of Birth'))
self.textbox5 = row5.addItem(viz.addTextbox())
self.content.addItem(row5)
row6 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row6.addItem(viz.addText('City of Birth'))
self.textbox6 = row6.addItem(viz.addTextbox())
self.content.addItem(row6)
#Add group to dialog content section
#Add a new subgroup containing other textboxes ( coded by me )
group2 = vizdlg.Panel()
#Add row for textboxes
row7 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row7.addItem(viz.addText('Passport No.'))
self.textbox7 = row7.addItem(viz.addTextbox())
self.content.addItem(row7)
row8 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row8.addItem(viz.addText('Purpose'))
self.textbox8 = row8.addItem(viz.addTextbox())
self.content.addItem(row8)
row9 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False,margin=10)
row9.addItem(viz.addText('Employment State'))
self.textbox9 = row9.addItem(viz.addTextbox())
self.content.addItem(row9)
#Add the row to subgroup
#Add a new row
row0 = vizdlg.Panel(layout=vizdlg.LAYOUT_HORZ_CENTER,border=False,background=False)
row0.addItem(viz.addText('Criminal History'))
self.checkbox = row0.addItem(viz.addCheckbox())
#Add the row to subgroup
group2.addItem(row0)
#Add group to dialog content section
self.content.addItem(group2)
#Hide cancel button
self.cancel.visible(1)
#Rename accept button to 'submit'
self.accept.message('Submit')
import viztask
def FormTask():
#Create input form
form = MyForm(title='Personal Details',background=False)
# form.background.alpha(0.1)
# form.setPosition(10,500)
#Link form to center of screen
viz.link(viz.MainWindow.CenterCenter,form)
while True:
#Wait for 'p' key to be pressed
yield viztask.waitKeyDown('p')
#TODO: Pause simulation
#Display form
yield form.show()
if form.accepted:
#User pressed 'Submit', process data
form_data = open('personal_details_form_'+str(form.textbox0.get()),'w')
data = 'Character No. : ' + form.textbox0.get() + '\n' + 'Surame : ' + form.textbox1.get() + '\n' + 'Given name : ' + form.textbox2.get() + '\n' + 'Sex : ' + form.textbox3.get() + '\n' + 'Date of Birth : ' + form.textbox4.get() + '\n' + 'Country of Birth : ' + form.textbox5.get() + '\n' + 'City of Birth : ' + form.textbox6.get() + '\n' + 'Passport No. : ' + form.textbox7.get() + '\n' + 'Purpose : ' + form.textbox8.get() + '\n' + 'Employment State : ' + form.textbox9.get() + '\n'
form_data.write(data)
form_data.flush()
#TODO: Resume simulation
#Remove form when completely finished with it
form.remove()
viztask.schedule( FormTask() )
###################form ends here