Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Trường hợp xác nhận yêu cầu tính toán phức tạp và truy cập vào máy chủ và cơ sở dữ liệu, vv,. việc xử lý tải có thể cao. Điều này có thể là một nguồn gốc của vấn đề hiệu suất trong môi trường nhất định. | 3 Where validation requires complex calculations and access to servers and databases etc . the processing load can be high. This could be a source of performance problems in certain environments. To circumvent these and other problems you may use alternative approaches. Of course your application may not use Pmw widgets so yet another approach may be required. Personally I prefer not to use the built-in validation in Pmw widgets. If the action of formatting the content of the widget requires a redraw you may Note observe annoying display glitches particularly if the system is heavily loaded these may distract the user. The following method avoids these problems. To avoid validating every keystroke which is how the Pmw EntryField manages data input we will arrange for validation to be done in the following cases 1 When the user moves the mouse pointer out of the current field. 2 When the focus is moved from the field using the Tab key. 3 When the ENTER key is pressed. Validating this way means that you don t get false errors as an input string is built up. In figure 6.3 for example entering 192.311.40.10 would only raise a validation error when the field was left or if Return was pressed thereby reducing operator confusion and CPU overhead. Figure 6.3 Data verification error dialogs I Invalid Card-P. Format nnn-nnn 0 nnn 101 Invalid Logical Na. Format CP lex X Example_6_8.py import string from Tkinter import from validation import 114 CHAPTER 6 EVENTS BINDINGS AND .