تعلم البرمجة بلغة البايثون
قدمة لتكنتر يدعم Python مكتبات رسومات متعددة ، مثل Qt و wxWidgets وما إلى ذلك. لكن مكتبة واجهة المستخدم الرسومية القياسية في Python هي Tkinter. Tkinter هو اختصار لواجهة Tk. توفر Python حزمة tkinter ، والتي تحتوي على واجهة Tkinter.
Privacy Policy Tknter
android_studio
**Privacy Policy**
Ahmed built the The Basics Of Android Studio app as a Free app. This SERVICE is provided by Ahmed at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at The Basics Of Android Studio unless otherwise defined in this Privacy Policy.
**Information Collection and Use**
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to com.codingahmedfr.thebasicsofandroidstudio. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third-party services that may collect information used to identify you.
Link to the privacy policy of third-party service providers used by the app
* [Google Play Services](https://www.google.com/policies/privacy/)
* [AdMob](https://support.google.com/admob/answer/6128543?hl=en)
**Log Data**
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
**Cookies**
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
**Service Providers**
I may employ third-party companies and individuals due to the following reasons:
* To facilitate our Service;
* To provide the Service on our behalf;
* To perform Service-related services; or
* To assist us in analyzing how our Service is used.
I want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
**Security**
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
**Links to Other Sites**
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
**Children’s Privacy**
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13 years of age. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.
**Changes to This Privacy Policy**
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.
This policy is effective as of 2023-06-03
**Contact Us**
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at af7467816@gmail.com.
This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated by [App Privacy Policy Generator](https://app-privacy-policy-generator.nisrulz.com/)
Calucators
**Privacy Policy**
ahmed built the calculator app as a Free app. This SERVICE is provided by ahmed at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at calculator unless otherwise defined in this Privacy Policy.
**Information Collection and Use**
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to com.codingahmedfr.calculatris. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third-party services that may collect information used to identify you.
Link to the privacy policy of third-party service providers used by the app
* [Google Play Services](https://www.google.com/policies/privacy/)
* [AdMob](https://support.google.com/admob/answer/6128543?hl=en)
**Log Data**
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
**Cookies**
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
**Service Providers**
I may employ third-party companies and individuals due to the following reasons:
* To facilitate our Service;
* To provide the Service on our behalf;
* To perform Service-related services; or
* To assist us in analyzing how our Service is used.
I want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
**Security**
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
**Links to Other Sites**
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
**Children’s Privacy**
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13 years of age. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.
**Changes to This Privacy Policy**
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.
This policy is effective as of 2023-04-06
**Contact Us**
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at af7467816@gmail.com.
This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated by [App Privacy Policy Generator](https://app-privacy-policy-generator.nisrulz.com/)
quizeParivacy
**Privacy Policy**
MrAhmed built the Quize English app as a Free app. This SERVICE is provided by MrAhmed at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at Quize English unless otherwise defined in this Privacy Policy.
**Information Collection and Use**
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to com.example.oneher. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third-party services that may collect information used to identify you.
Link to the privacy policy of third-party service providers used by the app
* [Google Play Services](https://www.google.com/policies/privacy/)
* [AdMob](https://support.google.com/admob/answer/6128543?hl=en)
**Log Data**
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
**Cookies**
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
**Service Providers**
I may employ third-party companies and individuals due to the following reasons:
* To facilitate our Service;
* To provide the Service on our behalf;
* To perform Service-related services; or
* To assist us in analyzing how our Service is used.
I want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
**Security**
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
**Links to Other Sites**
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
**Children’s Privacy**
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13 years of age. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.
**Changes to This Privacy Policy**
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.
This policy is effective as of 2023-02-09
**Contact Us**
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at af7467816@gmail.com.
This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated by [App Privacy Policy Generator](https://app-privacy-policy-generator.nisrulz.com/)
privacypolicygui
**Privacy Policy**
MrAhmed built the python tkinter gui app as a Free app. This SERVICE is provided by MrAhmed at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at python tkinter gui unless otherwise defined in this Privacy Policy.
**Information Collection and Use**
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to com.codingahmedfr.osterloop. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third-party services that may collect information used to identify you.
Link to the privacy policy of third-party service providers used by the app
* [Google Play Services](https://www.google.com/policies/privacy/)
* [AdMob](https://support.google.com/admob/answer/6128543?hl=en)
**Log Data**
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
**Cookies**
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
**Service Providers**
I may employ third-party companies and individuals due to the following reasons:
* To facilitate our Service;
* To provide the Service on our behalf;
* To perform Service-related services; or
* To assist us in analyzing how our Service is used.
I want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
**Security**
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
**Links to Other Sites**
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
**Children’s Privacy**
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13 years of age. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.
**Changes to This Privacy Policy**
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.
This policy is effective as of 2023-02-04
**Contact Us**
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at af7467816@gmail.com.
This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated by [App Privacy Policy Generator](https://app-privacy-policy-generator.nisrulz.com/)
Tkinter Button
Tkinter Button
مقدمة إلى أداة زر Tkinter
تمثل أدوات الأزرار عنصرًا قابلاً للنقر في التطبيقات. عادةً ما تستخدم نصًا أو صورة لعرض الإجراء الذي سيتم تنفيذه عند النقر فوقها.
يمكن للأزرار عرض النص بخط واحد. ومع ذلك ، يمكن أن يمتد النص على عدة أسطر. علاوة على ذلك ، يمكنك جعل أحد الأحرف تسطيرًا لتمييز اختصار لوحة المفاتيح.
لاستدعاء وظيفة أو
طريقة من فئة تلقائيًا
عند النقر فوق الزر ، يمكنك تعيين command
خيارها
للوظيفة أو الطريقة. يسمى هذا
الأمر بالربط في Tkinter .
لإنشاء
زر ، يمكنك استخدام ttk.Button
المُنشئ
على النحو التالي:
button = ttk.Button(container, **option)
الزر له العديد من الخيارات. ومع ذلك ، فإن النماذج النموذجية هي كما يلي:
button = ttk.Button(container, text, command)
في بناء الجملة هذا:
هو المكون
container
الرئيسي الذي تضع فيه الزر.هي تسمية
text
الزر.تحدد وظيفة
command
رد الاتصال التي سيتم استدعاؤها تلقائيًا عند النقر فوق الزر.
رد نداء الأمر
يربط command
الخيار
إجراء الزر بوظيفة أو طريقة لفئة. عند
النقر فوق الزر أو الضغط عليه ، فإنه يقوم
تلقائيًا باستدعاء وظيفة رد الاتصال.
لتعيين
رد نداء command
للخيار
، يمكنك استخدام تعبير lambda:
def callback():
# do something
ttk.Button(
root,
text="Demo Button",
command=callback
)
إذا كانت الوظيفة تحتوي على تعبير واحد ، فإنك تستخدم تعبير لامبا:
ttk.Button(
root,
text="Demo Button",
command=lambda_expression
)
حالات الزر
الحالة
الافتراضية للزر هي normal
. في normal
الحالة
، سيستجيب الزر لأحداث الماوس وضغطات
لوحة المفاتيح عن طريق استدعاء وظيفة رد
الاتصال المعينة لخيار الأمر الخاص به.
يمكن
أن يكون للزر disabled
الحالة
أيضًا. في disabled
الحالة
، يكون الزر غير نشط ولا يستجيب لأحداث
الماوس وضغطات لوحة المفاتيح.
للتحكم
في حالة الزر ، يمكنك استخدام state()
الطريقة:
button.state(['disabled'])
button.state(['!disabled'])
أمثلة زر Tkinter
لنأخذ بعض الأمثلة على استخدام أدوات الأزرار.
1) مثال زر بسيط Tkinter
يوضح
البرنامج التالي كيفية عرض Exit
زر. عند
النقر فوقه ، يتم إنهاء البرنامج.
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
root.geometry('300x200')
root.resizable(False, False)
root.title('Button Demo')
exit_button = ttk.Button(
root,
text='Exit',
command=lambda: root.quit()
)
exit_button.pack(
ipadx=5,
ipady=5,
expand=True
)
root.mainloop()
كيف تعمل.
ما
يلي يُنشئ Exit
الزر:
exit_button = ttk.Button( root, text='Exit', command=lambda: root.quit() )
يتم تعيين أمر الزر لتعبير lambda الذي يغلق نافذة الجذر.
2) مثال زر تكينتر الصورة
يوضح البرنامج التالي كيفية عرض زر الصورة. للتدرب على هذا المثال ، تحتاج إلى تنزيل الصورة التالية أولاً:
فقط
انقر بزر الماوس الأيمن واحفظه في مجلد
يمكن الوصول إليه من البرنامج التالي ،
على سبيل المثال ، assets
المجلد:
import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import showinfo
root = tk.Tk()
root.geometry('300x200')
root.resizable(False, False)
root.title('Image Button Demo')
def download_clicked():
showinfo(
title='Information',
message='Download button clicked!'
)
download_icon = tk.PhotoImage(file='./assets/download.png')
download_button = ttk.Button(
root,
image=download_icon,
command=download_clicked
)
download_button.pack(
ipadx=5,
ipady=5,
expand=True
)
root.mainloop()
كيف تعمل.
أولاً ، قم بإنشاء مثيل جديد
tk.PhotoImage
للفئة التي تشير إلى ملف الصورة'./assets/download.png'
.ثانيًا ، قم بإنشاء
ttk.Button
خيار الصورة الذي تم تعيينه للصورة.ثالثًا ، قم بتعيين وظيفة
command
للخيار. عند النقر فوق الزر ، سوف يقوم باستدعاءdownload_clicked
الوظيفة التي تعرض مربع رسالة.
3) عرض زر الصورة
لعرض
كل من النص والصورة على زر ، تحتاج إلى
استخدام compound
الخيار. إذا
لم تقم بذلك ، فسيعرض الزر النص فقط وليس
الصورة.
يوضح ما يلي كيفية عرض كل من النص والصورة على زر:
import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import showinfo
root = tk.Tk()
root.geometry('300x200')
root.resizable(False, False)
root.title('Image Button Demo')
def download_clicked():
showinfo(
title='Information',
message='Download button clicked!'
)
download_icon = tk.PhotoImage(file='./assets/download.png')
download_button = ttk.Button(
root,
image=download_icon,
text='Download',
compound=tk.LEFT,
command=download_clicked
)
download_button.pack(
ipadx=5,
ipady=5,
expand=True
)
root.mainloop()
privacy policy
**Privacy Policy**
ahmed built the python tkinter arabic app as a Free app. This SERVICE is provided by ahmed at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at python tkinter arabic unless otherwise defined in this Privacy Policy.
**Information Collection and Use**
For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information, including but not limited to com. The information that I request will be retained on your device and is not collected by me in any way.
The app does use third-party services that may collect information used to identify you.
Link to the privacy policy of third-party service providers used by the app
* [Google Play Services](https://www.google.com/policies/privacy/)
* [AdMob](https://support.google.com/admob/answer/6128543?hl=en)
**Log Data**
I want to inform you that whenever you use my Service, in a case of an error in the app I collect data and information (through third-party products) on your phone called Log Data. This Log Data may include information such as your device Internet Protocol (“IP”) address, device name, operating system version, the configuration of the app when utilizing my Service, the time and date of your use of the Service, and other statistics.
**Cookies**
Cookies are files with a small amount of data that are commonly used as anonymous unique identifiers. These are sent to your browser from the websites that you visit and are stored on your device's internal memory.
This Service does not use these “cookies” explicitly. However, the app may use third-party code and libraries that use “cookies” to collect information and improve their services. You have the option to either accept or refuse these cookies and know when a cookie is being sent to your device. If you choose to refuse our cookies, you may not be able to use some portions of this Service.
**Service Providers**
I may employ third-party companies and individuals due to the following reasons:
* To facilitate our Service;
* To provide the Service on our behalf;
* To perform Service-related services; or
* To assist us in analyzing how our Service is used.
I want to inform users of this Service that these third parties have access to their Personal Information. The reason is to perform the tasks assigned to them on our behalf. However, they are obligated not to disclose or use the information for any other purpose.
**Security**
I value your trust in providing us your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.
**Links to Other Sites**
This Service may contain links to other sites. If you click on a third-party link, you will be directed to that site. Note that these external sites are not operated by me. Therefore, I strongly advise you to review the Privacy Policy of these websites. I have no control over and assume no responsibility for the content, privacy policies, or practices of any third-party sites or services.
**Children’s Privacy**
These Services do not address anyone under the age of 13. I do not knowingly collect personally identifiable information from children under 13 years of age. In the case I discover that a child under 13 has provided me with personal information, I immediately delete this from our servers. If you are a parent or guardian and you are aware that your child has provided us with personal information, please contact me so that I will be able to do the necessary actions.
**Changes to This Privacy Policy**
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page.
This policy is effective as of 2022-10-24
**Contact Us**
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at af7467816@gmail.com.
This privacy policy page was created at [privacypolicytemplate.net](https://privacypolicytemplate.net) and modified/generated by [App Privacy Policy Generator](https://app-privacy-policy-generator.nisrulz.com/)
Tkinter تعلم لغة بايثون
قدمة لتكنتر
يدعم Python مكتبات رسومات متعددة ، مثل Qt و wxWidgets وما إلى ذلك. لكن مكتبة واجهة المستخدم الرسومية القياسية في Python هي Tkinter. Tkinter هو اختصار لواجهة Tk. توفر Python حزمة tkinter ، والتي تحتوي على واجهة Tkinter.
ابدأ الكتابة
لاستخدام Tkinter ، تحتاج أولاً إلى استيراد وحدة tkinter التي تقدمها Python:
1
import
tkinter as tk
يستورد هذا البيان وحدة tkinter ، ولكن من أجل الراحة ، يتم تحديد الاسم المستعار tk لها.
في نظام واجهة المستخدم الرسومية ، يوجد مفهوم القطعة. عناصر التحكم هي أشياء مثل الأزرار وأشرطة التمرير ومربعات النص. على وجه الخصوص ، النافذة هي أيضًا عنصر تحكم ، يمكن للنافذة استيعاب عناصر التحكم الأخرى. في Tkinter ، استخدم فئة الإطار لتمثيل النافذة. يمكن لبرنامجنا إنشاء كائن إطار مباشرة وإضافة عناصر تحكم إليه ، ولكن من المعتاد اشتقاق فئة التطبيق (تسمى أيضًا أسماء أخرى) من فئة الإطار
class
Application(tk.Frame):
بعد ذلك ، نحتاج إلى كتابة مُنشئ __it__ للتطبيق:
1
2
3
4
def init(self,
master=None):
tk.Frame.init(self,
master)
self.grid()
self.createWidgets()
import tkinter as Tk
بعد
ذلك نقوم باستدعاء الدالة mainloop
والتي
تقوم بعمل استمرار لانهائي لظهور النافذة
بانتظار بانتظار أن يتفاعل معها المستخدم
أو يغلقها، ويكون ذلك بإضافة السطر التالي:
import tkinter as Tk
mainwindow = Tk.Tk()
main_window.mainloop()
from tkinter import * استدعاء المكتبة الرسوميات او الواجهات مكتبة تكينتر
root = Tk() ربط متغير بالكلاس
root.mainloop()
الكود التجربي انسخ
الناتج هو
rom tkinter import *
root = Tk()
root.mainloop()
Run مباشرة أو ضغط على F5 لتنفيد برنامج في كونسل بايثون نضغط