Apress Pro PHP-GTK phần 6

Trong khi các nội dung của mỗi tế bào là độc lập, kích thước của một hàng hoặc cột được xác định bởi các tế bào lớn nhất trong hàng hoặc cột. Listing 6-3 là một thực hiện của phương pháp _populate từ trước đó. Chuyên môn hóa và trừu tượng của trách nhiệm của các lớp này làm cho một bộ công cụ rất mạnh mẽ mà có thể cung cấp sự linh hoạt gần như vô tận khi nói đến một mô hình sẽ được hiển thị và truy cập. Bây giờ bạn đã thấy như thế. | 178 CHAPTER 8 USING MULTILINE TEXT Summary Multiline text is a powerful tool not only for displaying large amounts of text but also for collecting large amounts of data from the user. Using multiline text can be simple or rather complex. If plain black text is all you need you can easily set up a GtkTextView with a buffer. If the text needs to be formatted or modified GtkTextIter GtkTextMark and GtkTextTag allow that to happen. All of these widgets and objects make for a well-designed and specialized tool set. Text is not the only type of data that comes in large quantities. There are other types of large data sets such as arrays and trees that cannot be properly displayed with any of the tools seen so far. In Chapter 9 we will look at how to display large amounts of data. We will look at using trees and lists as the models behind several different ways to display data. Among the types of data that our sample application will display are a list of news headlines and a sortable and expandable list of products. CHAPTER 9 Working with Trees and Lists I n the past two chapters you ve learned how to display and edit both small and large blocks of text. Yet there is still another type of data that requires special handling collections. Collections are made up of several elements grouped using data structures such as arrays lists and trees. For a collection you may need to show the relationship between individual elements sort the collection and filter certain values. The tools that have been introduced so far cannot easily fulfill these needs. PHP-GTK handles collections of data in a manner similar to how it manages multiline text. One group of objects organizes the data while another concentrates on the display. This allows you to show one set of data in multiple ways at the same time. Without this separation of responsibility each piece of the application that wanted to gather information from a data set would have to create and manage its own instance of the data. .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
2    780    2    22-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.