Search code examples
tcltk-toolkit

tcl - tk entry and text box delete


I have a small gui with a combobox, two entry widgets, .main_frame.login_data and .main_frame.password, and a text widget, .box.notes_box. There's a bind on the combobox that runs this stuff:

    bind .main_frame.rec_name_entry <<ComboboxSelected>> {
        .main_frame.login_data delete 0 end
        .main_frame.password_data delete 0 end
        .box.notes_box delete 1.0 end

        set pq ""
        dec_db $account $key
        sqlite3 get_data $account.db
        set pq [string map {"\{" "" "\}" ""} [get_data eval {SELECT login FROM pw WHERE desc=$description}]]
        set lq [string map {"\{" "" "\}" ""} [get_data eval {SELECT password FROM pw WHERE desc=$description}]]
        set nt [string map {"\{" "" "\}" ""} [get_data eval {SELECT notes FROM pw WHERE desc=$description}]]
        get_data close
        enc_db $account $key

        .main_frame.login_data insert 0 $pq
        .main_frame.password_data insert 0 $lq
        .box.notes_box insert 1.0 $nt
    }

Right under "bind", I'm trying to delete the contents of the entry fields and the text box, and it will do that, however, it won't delete that stuff until after the decrypt/sqlite stuff/encrypt .. just before it fills in the fields with the new values retrieved from the db. Is there some caching or something going on that I need to flush? the sqlite stuff in between only takes about a second, but I want the fields blanked out in that time. Or does this event not run sequentially?


Solution

  • adding update after widget deletes is the answer