Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7751439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:32:52+00:00 2026-06-01T11:32:52+00:00

I have a seesaw ui with a text editor. The editor content is backed

  • 0

I have a seesaw ui with a text editor. The editor content is backed by a record called ‘Task’ which is contained somewhere in an atom called ‘state’. A key-released event on the editor should change the property :desc of the Task. I use the following code:

(def state
     (atom {:tasks []
            :interval nil
            :style (style :foreground :black :background nil)}))

(defn on-text-edited [ui listener-fn]
  (let [editor (select ui [:#editor])]  
    (listen editor :key-released
        (fn [evt] (listener-fn (text editor))))))

(defn update-task! [task text]
  (let [newtask (assoc task :desc text)
        tasks (replace {task newtask} (:tasks @state))]
  (swap! state
     #(assoc % :tasks tasks))))

(def text-updates (on-text-edited frame #(update-task! selected-task %)))

selected-task is an atom referencing the current content model of the editor. Whenever the user edits text the update-task! function is supposed to be called. But nothing happens. The function seems not to be called at all. When I call it from the repl it behaves as expected.

I tested if the function would get called by letting it do a simple println:

(defn update-task! [task text]
   (println (str task " " text)))

Now the function works fine when I edit text in the editor. Then I changed it to:

(defn update-task! [task text]
  (let [newtask (assoc task :desc text)
        tasks (replace {task newtask} (:tasks @state))]
     (println (str task " " text))))

now again, it would do nothing at all. So it seems that somehow the accessing of the atoms get in the way of the event handling. Is there maybe a conflict between the ui thread and the thread the atoms were defined in?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:32:54+00:00Added an answer on June 1, 2026 at 11:32 am

    In a case like this where it works in the simple case and stops in a more complex case, I’d guess that there’s an exception occurring, probably in assoc or replace in the let bindings. Depending on your dev environment, the exception may be hidden since it happens on the UI thread.

    I’d suggest try calling seesaw.dev/debug! which will popup a ui with a stack trace whenever an unhandled exception is thrown in the UI thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a table called person. which has personid and contactid. if a person is
Have a text box which get data for price. If someone enter something like
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
Have a simple one-off tasks which needs a progress bar. OpenSSL has a useful
Have some validating problems which seem to appear only when using the Auth component.
Have the following code: String s= v.request(engine/?key=, P4z72NmBa91&method=load); JSONParser parser = new JSONParser(); Object
Have just started using Visual Studio Professional's built-in unit testing features, which as I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.