Menu

Sortable Columns in GTK4: ColumnView, ColumnViewSorter and GridView
📰

Sortable Columns in GTK4: ColumnView, ColumnViewSorter and GridView

DEV Community: rust·Justin - FromTheArchitect·about 22 hours ago
#MWKlJ8nN
#devtorust#devto#dev#column#sort
Reading 0:00
15s threshold

This is the eighth entry in A Field Guide to GTK Widgets , a series about which widget to reach for, when, and what bites you when you do. The previous post taught the store to report its own changes. This one puts a table and a grid on top of it. The complete, runnable code lives in the companion repo .

Where we left off

Every view in this series so far has been a ListView : one row per item, one widget per row. The model stack under it grew from a store and a selection to four layers, and the last post made the store report when an item changed so the sort model above it could keep up.

This post swaps the view. The example is a small photo library, twelve photos from three cameras, shown two ways. One is a ColumnView , a table with a header you can click to sort, columns you can drag wider or narrower, and columns you can drag into a different order. The other is a GridView of tiles.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.