Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet161/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   157   158   159   160   161   162   163   164   ...   453
146

CHAPTER 8
Creating WindoWs Forms appliCations
properties when your application will see even moderate use by those with special physical needs. 
Obviously, you don’t add precisely the same code to your IronPython application that the Visual 
Designer adds to the C# or Visual Basic.NET application, but the Visual Designer file provides enough 
insight to make the transition to IronPython work with relative ease.
Performing Quick Form Tests
You’ll want to see your form from time to time, before you’ve written the rest of the application code. 
Fortunately, you’re using IronPython, so you have the interpreter at your disposal. The following steps 
outline a quick way to see what your form looks like.
1.
Start the interpreter (
IPY.EXE
) in the directory that contains the form code.
2.
Type 
from frmMain import *
and press Enter. This step imports the form into the inter-
preter for testing.
3.
Type 
TestForm = frmMain()
and press Enter. This step instantiates a copy of 
frmMain
that 
you’ll use for testing.
4.
Type 
TestForm.InitializeComponent()
and press Enter. In this step, you execute the code 
used to create and configure the controls within the form.
5.
Type 
TestForm.ShowDialog()
and press Enter. At this point, you see the dialog box appear 
onscreen, just as you’d normally see it when executed from the application. However, you see 
just the dialog box and its controls. The dialog box is pretty much non-functional because 
you don’t have any event handlers in place.
6.
After you finish viewing the dialog box, click Cancel or the close button. This act
closes the dialog box. You’ll see a dialog result value as part of the output, as shown
in Figure 8-4.
FIguRE 8-4: 
This output shows a typical form-viewing session in the interpreter.
Even though this technique is a little limited, it does give you a view of your form so that you can 
easily fix any problems. You must repeat the entire process every time you want to test changes 
to the form. The act of importing the form code means that you won’t see any changes within the 
interpreter until you import the form code again. In short, if you make changes and don’t see them 
during testing, it’s probably because you didn’t exit the interpreter and start over.
548592c08.indd 146
2/24/10 12:48:09 PM
www.finebook.ir



Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   157   158   159   160   161   162   163   164   ...   453




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish