Re: [CAPI] enabling / disabling layouts
"Didier Verna (as didier at didierverna dot net)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
"Martin Půda (as mapuda at seznam dot cz)" <[email protected]> wrote: > to disable contents of layout, use (mapcar (lambda (pane) (setf > (capi:simple-pane-enabled pane) nil)) (capi:layout-description > your-layout)). Thanks. LAYOUT-DESCRIPTION is an interesting clue, but unfortunately it seems that recursively traversing a layout is too complicated. SIMPLE-PANE-ENABLED doesn't work on all layout description object (e.g. PANE-GEOMETRY, whatever that is). So I ended up keeping a list of sub-panes that need enabling / disabling. The conjunction of a visible-child-function (that always returns the old pane) and a selection-callback (that does nothing) emulates a disabled tab-layout relatively well. The only remaining problem is that since the tab buttons are still enabled, you can still click on them and they get (wrongly) highlighted. I found that doing (setf (choice-selection my-tab-layout) the-old-selection) restores the correct button to highlight. Of course, it's somewhat dangerous since I'm calling a function that triggers the callback within the callback itself. I'm not even sure it's supposed to work. However, if you do it only if the currently highlighted button is the wrong one, you avoid an infinite callback loop and it seems to work. -- Resistance is futile. You will be jazzimilated. Lisp, Jazz, Aïkido: http://www.didierverna.info _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html