Changeset 3549


Ignore:
Timestamp:
Sep 7, 2006, 5:11:21 PM (18 years ago)
Author:
jack
Message:

Resizing now works on the visualiser.

Location:
anuga_core/source/anuga/visualiser
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/visualiser/offline.py

    r3548 r3549  
    100100    def setup_gui(self):
    101101        Visualiser.setup_gui(self)
    102         self.tk_renderWidget.grid(row=0, column=0, columnspan=6)
    103         self.tk_quit.grid(row=2, column=0, columnspan=6, sticky=W+E)
    104         self.tk_restart = Button(self.tk_root, text="<<<", command=self.restart)
     102        self.tk_quit.grid(row=0, column=0, columnspan=6, sticky=W+E)
     103        self.tk_restart = Button(self.tk_controlFrame, text="<<<", command=self.restart)
    105104        self.tk_restart.grid(row=1, column=0, sticky=W+E)
    106         self.tk_back10 = Button(self.tk_root, text="<<", command=self.back10)
     105        self.tk_back10 = Button(self.tk_controlFrame, text="<<", command=self.back10)
    107106        self.tk_back10.grid(row=1, column=1, sticky=W+E)
    108         self.tk_back = Button(self.tk_root, text="<", command=self.back)
     107        self.tk_back = Button(self.tk_controlFrame, text="<", command=self.back)
    109108        self.tk_back.grid(row=1, column=2, sticky=W+E)
    110         self.tk_pauseResume = Button(self.tk_root, text="Pause", command=self.pauseResume)
     109        self.tk_pauseResume = Button(self.tk_controlFrame, text="Pause", command=self.pauseResume)
    111110        self.tk_pauseResume.grid(row=1, column=3, sticky=W+E)
    112         self.tk_forward = Button(self.tk_root, text=">", command=self.forward)
     111        self.tk_forward = Button(self.tk_controlFrame, text=">", command=self.forward)
    113112        self.tk_forward.grid(row=1, column=4, sticky=W+E)
    114         self.tk_forward10 = Button(self.tk_root, text=">>", command=self.forward10)
     113        self.tk_forward10 = Button(self.tk_controlFrame, text=">>", command=self.forward10)
    115114        self.tk_forward10.grid(row=1, column=5, sticky=W+E)
     115
     116        # Make the buttons stretch to fill all available space
     117        for i in range(6):
     118            self.tk_controlFrame.grid_columnconfigure(i, weight=1)
    116119
    117120    def restart(self):
  • anuga_core/source/anuga/visualiser/realtime.py

    r3540 r3549  
    2727    def setup_gui(self):
    2828        Visualiser.setup_gui(self)
    29         self.tk_pauseResume = Button(self.tk_root, text="Pause", command=self.pauseResume)
     29        self.tk_pauseResume = Button(self.tk_controlFrame, text="Pause", command=self.pauseResume)
    3030        self.tk_pauseResume.grid(row=1, column=0, sticky=E+W)
    3131
  • anuga_core/source/anuga/visualiser/visualiser.py

    r3548 r3549  
    11from threading import Thread
    2 from Tkinter import Tk, Button, N, E, S, W
     2from Tkinter import Tk, Button, Frame, N, E, S, W
    33from types import FunctionType, TupleType
    44from vtk import vtkActor, vtkFloatArray, vtkPolyDataMapper, vtkRenderer
     
    142142        self.tk_root.after(100, self.redraw)
    143143        self.tk_root.bind("<Destroy>", self.destroyed)
     144        self.tk_root.grid_rowconfigure(0, weight=1)
     145        self.tk_root.grid_columnconfigure(0, weight=1)
    144146
    145147        self.tk_renderWidget = vtkTkRenderWidget(self.tk_root, width=400, height=400)
    146148        self.tk_renderWidget.grid(row=0, column=0, sticky=N+S+E+W)
    147         self.tk_quit = Button(self.tk_root, text="Quit", command=self.shutdown)
    148         self.tk_quit.grid(row=2, column=0, sticky=E+W)
     149        self.tk_controlFrame = Frame(self.tk_root)
     150        self.tk_controlFrame.grid(row=1, column=0, sticky=E+W)
     151        self.tk_controlFrame.grid_rowconfigure(0, weight=1)
     152        self.tk_controlFrame.grid_columnconfigure(0, weight=1)
     153       
     154        self.tk_quit = Button(self.tk_controlFrame, text="Quit", command=self.shutdown)
     155        self.tk_quit.grid(row=0, column=0, sticky=E+W)
    149156        self.vtk_renderer = vtkRenderer()
    150157        self.tk_renderWidget.GetRenderWindow().AddRenderer(self.vtk_renderer)
Note: See TracChangeset for help on using the changeset viewer.