سؤال

لقد قمت بإنشاء Textarea في مشروع Python الخاص بي باستخدام PythonCard

المشكلة هي أنه لا أعرف كيفية الاتصال به في مشروعي لتغيير النص. يطلق عليه mytextarea.

شكرًا

هل كانت مفيدة؟

المحلول

شاهد Doc Textarea هنا: http://pythoncard.sourceforge.net/framework/components/textarea.html.

أعتقد أن الأساليب التي تريد استخدامها هي Appendtext و WRITETEXT

نصائح أخرى

من داخل فئة واجهة المستخدم الرسومية التي تم إنشاؤها بيثونكارد:

self.components.myTextArea.clear() ## clear the TextArea
self.components.myTextArea.text = "initial text" ## directly set text
self.components.myTextArea.appendText("\nhello world") ## append text
self.components.myTextArea.writeText("\nhello world2") ## append text
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top