[ase-users] Updating the gui window without opening a new window?

Colin Bousige colin.bousige at gmail.com
Wed Feb 7 17:56:42 CET 2018


Hi Ask,

And thanks a lot for your answer.

What I want to do is a user-friendly tool with tkinter to build a specific structure with some parameters that the user enters. 
Then I want the resulting structure to be displayed, and update this display as the user changes the parameters – the slab was just an example.

So I guess a solution for this would be either:
- a way to trigger a gui update on demand or as it detects a change in the structure
- or display the gui as a frame within my tkinter app?
- or maybe just a way to close the gui window and then open a new one with view()
- or develop my app as an ASE plugin – which I would like avoiding doing...

And concerning edit(), it only results in crashing my python session, so I don’t know what I can do with it…
I use Anaconda python 3.6.2 on OSX and installed ASE with 'conda install -c conda-forge ase'.

Thanks a lot,
Colin

> On 7 Feb 2018, at 17:15, Ask Hjorth Larsen <asklarsen at gmail.com> wrote:
> 
> Hi Colin,
> 
> 2018-02-06 15:11 GMT+01:00 Colin Bousige via ase-users
> <ase-users at listserv.fysik.dtu.dk <mailto:ase-users at listserv.fysik.dtu.dk>>:
>> Hi,
>> 
>> I am building a tool to easily construct some structure using tkinter to input some values and ase to show the resulting structure.
>> 
>> My question is: how do you update the gui window with a modified structure *without* opening a new window ?
>> 
>> Here is a short example showing my problem:
>> 
>> ```python
>> from ase import Atoms
>> from ase.visualize import view
>> from ase.build import fcc111
>> 
>> slab = fcc111('Ag', size=(5,6,1), a=4, orthogonal=True)
>> view(slab)
>> # now we modify this slab (in my case this is done via tkinter where eg. the user can set size=(i,j,k))
>> slab = fcc111('Ag', size=(5,6,3), a=4, orthogonal=True)
>> view(slab) # Here I would like the view of the structure to be updated as I change it, and not open a new gui window
>> ```
> 
> The 'view' command always opens a new process.
> 
> I don't completely understand what you need to do - the slab is
> modified by the user, yet you later replace it?
> 
> You may wish to try slab.edit().
> 
> Best regards
> Ask
> 
> 
>> 
>> Thanks in advance for your help,
>> Colin
>> _______________________________________________
>> ase-users mailing list
>> ase-users at listserv.fysik.dtu.dk <mailto:ase-users at listserv.fysik.dtu.dk>
>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users <https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20180207/3ba146e3/attachment-0001.html>


More information about the ase-users mailing list