From eefdbf79bc2b83b40477abf102f5722f73f31741 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Mon, 20 May 2019 21:58:17 +0200 Subject: Change parameter window into dialog --- fieldicle.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/fieldicle.py b/fieldicle.py index 347d8e6..6e2bd9b 100644 --- a/fieldicle.py +++ b/fieldicle.py @@ -1,5 +1,3 @@ -from __future__ import absolute_import - import pyopencl as cl mf = cl.mem_flags from pyopencl.tools import get_gl_sharing_context_properties @@ -183,14 +181,11 @@ particleWindow = ParticleWindow() glfwThread = threading.Thread(target=particleWindow.run) glfwThread.start() -class ParamWindow(Gtk.Window): +class ParamWindow(Gtk.Dialog): def __init__(self, particleWin): - Gtk.Window.__init__(self, title="Field Parameters") + Gtk.Dialog.__init__(self, title="Field Parameters") self.particleWin = particleWin - self.grid = Gtk.Grid() - self.add(self.grid) - self.button = Gtk.Button(label="Update field") self.button.connect("clicked", self.on_button_clicked) @@ -198,10 +193,10 @@ class ParamWindow(Gtk.Window): self.entryFy = Gtk.Entry() self.entryFz = Gtk.Entry() - self.grid.add(self.button) - self.grid.add(self.entryFx) - self.grid.add(self.entryFy) - self.grid.add(self.entryFz) + self.get_content_area().add(self.button) + self.get_content_area().add(self.entryFx) + self.get_content_area().add(self.entryFy) + self.get_content_area().add(self.entryFz) def on_button_clicked(self, widget): self.particleWin.updateField( -- cgit v1.2.3