Python Forum

Full Version: How can I position a taichi GUI window on screen?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have started to work with Taichi Lang package and I couldn't find how to position the GUI window.
A simple example:

import taichi as ti

gui = ti.GUI("Test", (640, 480))

while gui.running:
  if gui.get_event(ti.GUI.PRESS):
  gui.running = False
  # ... 
  gui.show()
Each time I run this, the window is placed at different locations. I would like to have a fixed location, mainly for automatic image screenshots and animation recordings in which the window needs to be grabbed.
Is there a way to fix the location of the window?

(I'm sorry for the "hard" indentation. The icon "Insert code snippet" doesn't work for me, in any way I tried. Neither does indentation, since any left margin (blank space) is just removed.)
From the docs

import taichi as ti

gui = ti.ui.Window('Something', res=(800,600), pos=(300,300))

while gui.running:
    gui.show()