Switching tabs in callback mode
Hi,
I have a tab layout in callback mode. Each tab contains a collector pane.
When the callback switches the tab, the correct pane is displayed, but the
tab label isn't switched to the front.
What am I missing? (Using LWW 4.3.6.)
Alternatively, how do I switch switchable-mode tabs programmatically? In my
application, the collector pane in each tab collects program output;
depending on context I'd like to bring the user's attention to a particular
tab.
TIA! Cheers.
(defvar *i* nil)
(defun switch-tab (tab)
(setf (tab-layout-visible-child (slot-value *i* 'tab-layout-1)) tab))
(define-interface interface-1 ()
()
(:panes
(c1
collector-pane
:reader c1-reader)
(c2
collector-pane
:reader c2-reader))
(:layouts
(tab-layout-1
tab-layout
()
:items '(("pane 1" c1)
("pane 2" c2))
:print-function 'car
:visible-child-function nil
:callback-type :data
:selection-callback #'(lambda (data) (switch-tab (second data)))))
(:default-initargs
:best-width 300
:best-height 300
:layout 'tab-layout-1
:title "interface 1"))
(defun rant (pane)
(with-open-stream (s (collector-pane-stream pane))
(write-line "blah blah" s)))
(defun test ()
(display (setf *i* (make-instance 'interface-1))))
(test)
(rant (c2-reader *i*))
(apply-in-pane-process *i* 'switch-tab (c2-reader *i*))
--
Ng Pheng Siong <ngps@netmemetic.com>
http://firewall.rulemaker.net -+- Firewall Change Management & Version Control
http://sandbox.rulemaker.net/ngps -+- Open Source Python Crypto & SSL