Fork me on GitHub

Can anyone confirm whether e26-tooltips works (or does not)? For me it doesn't. I get a big black circle but waving the mouse across it has no effect. What should happen is you see a tooltip that tells you the radius of the circle. I'm using JDK 12.0.1 and the "RELEASE" version of cljfx.


@cjmurphy i verified it works for me on the latest cljfx master ... i verified with JDK 11 and 12 on mac os (once i hover, it takes 1-2 seconds for the tooltip to show) hope this helps


Thank you @atdixon. Yes works for me too I just wasn't being patient enough with holding the mouse still for a good period of time.

🙂 3
👍 3

looking for advice i have a :label that is swapped for :text-field when clicked and i'd like .requestFocus on the :text-field after it is added i've tried ext-on-instance-lifecycle adding a .sceneProperty listener (requesting focus when scene is set on the new text-field), but the scene is updated on other rendering operations so the text-field will re-request focus at inopportune times am wondering if there is a more direct way to achieve this


follow up - if i have the listener remove itself after its first firing then this approach seems to work but :on-created doesn't get invoked when i have an :fx/key


but perhaps there's a better way to do focus management ...


@atdixon can you show your composition of :fx/key with ext-on-instance-lifecycle?


wild guess: you might need :on-advanced too


@vlaaad thanks! on-advanced worked really well

👍 3

this is roughly the code:

(defn task-row [{:tasks/keys [id name]} editing-id]
  (if (= id editing-id)
    {:fx/type fx/ext-on-instance-lifecycle
     :fx/key id
     :on-advanced #(let [listener
                         (reify ChangeListener
                           (changed [me _ _ v]
                             (doto ^TextField %2
                               (-> .sceneProperty
                                 (.removeListener me)))))]
                     (-> ^TextField %2 .sceneProperty
                       (.addListener listener)))
     :desc {:fx/type :text-field
            :text name}}
    {:fx/type fx/ext-on-instance-lifecycle
     :fx/key id
     :on-advanced #(let [listener
                         (reify ChangeListener
                           (changed [me _ _ v]
                             (doto ^Label %2
                               (-> .sceneProperty
                                 (.removeListener me)))))]
                     (-> ^Label %2 .sceneProperty
                       (.addListener listener)))
     :desc {:fx/type :label
            :text name
            :focus-traversable true}}))


i'm only using on-advanced...


on the first creation of the "task row" there's no need to request focus


but when the row goes into editing the :`label` is swapped for :text-field


when the :text-field is swapped back, the same technique is used to keep focus on the :label


...not sure if there's a better way to do this, or if there is danger lurking here 🙂