> (Python scripting option verendus est) > > In python script, it appears that show_select_map_dialog simply shows > the dialog and quits. I am trying to set up a method that would do > certain things depending on the choice of map. So I use > show_select_map_dialog, but it appears that it does not wait until user > makes a choice there. I tried to put a sleep cycle for 10 seconds that > would keep checking if map selection changed, but the dialog does not > show until the cycle is over. Is there any way to show the dialog and > then wait for user to make selection? > > Here is the version of the code that shows the dialog but then proceeds > further without waiting for selection > > --- > show_select_map_dialog() > imodel = (imol_refinement_map() - shknum)/2 > highlight_model(imodel) > --- > > Her is the code with sleep-cycle. This one only shows the map selection > dialog after 10 seconds (something equivalent to yield function in wx is > needed) > > --- > from time import sleep > imap = imol_refinement_map() > show_select_map_dialog() > for i in range(10): > if imap != imol_refinement_map(): > break > sleep(1) > imodel = (imol_refinement_map() - shknum)/2 > highlight_model(imodel) > > --- >
Not sure what you'd like to achieve, but perhaps the map_molecule_chooser_gui is what you are looking for. Something along the lines: map_molecule_chooser_gui("This is what I'll do to your map", lambda imol: my_map_manipulation_function(imol)) This brings up a map selector gui, the user selects the map, and you do whatever you want with the imol picked up. Other useful little widgets here: http://www.biop.ox.ac.uk/coot/doc/coot.html#coot_002dgui > -- > Coot verendus est > Indeed.