I was bored on the plane ride home, so I started writing some of the
generic UI code instead of documentation. :) Basically, this is similar to
the glyph stuff andy did, but pops up in its own window instead of being
embedded in a buffer or gutter area.
Basically, it works like this:
(defvar test-ui
'(window :type dialog
:items ((tab-control
:homogeneous t
:items ((box :orientation vertical
:tab-label (label :text "vertical")
:items ((label :text "Vertical")
(label :text "Box stacking")))
(box :orientation horizontal
:spacing 10
:items ((label :text "Horizontal box")
(label :text "stacking")))
(box :orientation vertical
:items
((radio-group
:items ((button :type radio
:text "Item 1")
(button :type radio
:text "Item 2")
(button :type radio
:text "Item 3")
(button :type radio)))))
(box :orientation vertical
:items ((button :type check
:text "Item 1")
(button :type check
:text "Item 2")
(button :type normal
:text "Item 3")
(button :type toggle)))
(text :editable t
:word-wrap t
:file (locate-data-file "COPYING"))
(text :editable t
:face display-time-mail-balloon-enhance-face
:word-wrap t
:text "Text with a face on it"))))))
(build-ui test-ui)
(show-ui test-ui)
I don't have any of the keymap stuff in there yet, but this is all written
in lisp for the GTK case, so that will be relatively simple to add.
The one thing I don't like is the radio-group requirement. I would prefer
to have used the :selected bit, but updates were a real problem there. You
can get away with it in the menu because you can update them just before
you pop them up, but with long-lived visible widgets, you'd want it to
update asynchronously. I didn't want to use an idle timer, because that
seemed like it would chew up a huge amount of CPU usage, etc.
Then again, I hate the :selected bits for radio buttons anyway. :)
-Bill P.
Show replies by date