Skip to content

tab/notebook broken by click-listeners not generated #16

@Giels

Description

@Giels

As the title says. My current workaround is to manually add the missing click-listeners as follows:

Given a layout like

(defpanel
 (notebook :name :notebook
  (tab :label "Hello"
   (label :text "Hi"))
 (tab :label "World"
  (label :text "everyone"))))

I add

(defmethod bodge-ui-window:on-ui-ready ((this main-window))
  (let* ((main-panel  (first (bodge-ui::%panels-of (bodge-ui-window:ui-window-context this))))
          (notebook (bodge-ui:find-element :notebook main-panel)))
    (loop for tab-btn in (bodge-util:children-of (slot-value notebook 'bodge-ui::tabbar))
	  for idx from 0 do
	  (setf (slot-value tab-btn 'bodge-ui::click-listener) (funcall (lambda (idx) (lambda (panel) (bodge-ui::select-tab notebook idx))) idx)))))

(using bodge-ui-window to take care of the boilerplate, not shown).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions