Ticket #1158 (closed enhancement: fixed)
Widgets should implement Eq and Ord.
| Reported by: | guest | Owned by: | axel |
|---|---|---|---|
| Priority: | trivial | Milestone: | 0.10.2 |
| Component: | general (Gtk+, Glib) | Version: | 0.9.12 |
| Keywords: | instance Eq Ord | Cc: |
Description
When using GTK+ from a typical imperative language such as C++, it's
occasionally useful to use the object identity of a widget: for instance, you might want to create a set of "main" windows and terminate the program only when all of them close. Since widgets are represented by pointers, this is straightforward, and they can be stored in any standard container class (such as std::set).
Unfortunately, the Haskell binding doesn't expose this information.
It would be nice if GTK+ objects had instances of Ord and Eq based on pointer identity. Then they could, e.g., be stored in Data.Set.Set objects.
(I know this can be worked around; it's just something that would
save a little trouble)
Daniel
Reported on Debian BTS: http://bugs.debian.org/520474