Rust GUI : nannou: link two Select List


#1

Hello.
I’m trying to write GUI apps in Rust …
tried using nannou which seems easier to use than conrod.

I have a problem I can’t solve :

I started building a test app with a connection to a sqlite database through diesel.
That very simple DB contains 2 tables : the first one with sexes (2 fields :id, espece (for men, women, unknown)), the second table with a few persons (from a struct Persons with fields id, prenom, nom, sexe_id) (I’m native French speaker)

The goal is to have a main window showing one ListSelect with the fields of the table sexes and one ListSelect with a list of persons filtered by sexes. The selected item of the ListSelect “sexes” being used as filter : when the selection of the first list select changes, the list in the second list selected should be modified and show a new list of items.

The first list select (sexes) appears correctly on the window, but the second list quickly flashes when the selection of the first list changes and doesn’t remain visible on the window … probably because it is linked to the selection event of the first list and on the events of the window.
Is there a way to solve the problem (tried several possibilities without success …) ?

Is there a possibility to instantiate the ListSelect outside all the event functions (in the model e.g.) and update the list when the selection in the other list changes ?

How can I open a new window (for CRUD operations) with the data of the selected item in the list, when the user double clicks in the list ?

Thanks in advance for your help.