Re: tkinter: loading file before entering mainloop

2009-03-16 Thread Eric Brunel
Peter Billam wrote: >> Peter Billam wrote: >> window = MainWindow(application) >> if (len(sys.argv) > 1) and os.path.exists(sys.argv[1]): >> window.loadFile(sys.argv[1]) >> application.mainloop() >> File "./midimix", line 465, in loadFile >> space0.grid(row=grid_row, >> pady=

Re: tkinter: loading file before entering mainloop

2009-03-16 Thread Peter Billam
Peter Billam wrote: >> They're multiplied up from >> canvas_height = self.canvas.winfo_height() >> so I guess mainloop already think it's idle, while grid is still >> taking 10ms to work out what goes where. On 2009-03-15, John McMonagle wrote: > You need to query the requested width and heigh

Re: tkinter: loading file before entering mainloop

2009-03-15 Thread John McMonagle
Peter Billam wrote: > On 2009-03-14, Peter Otten <__pete...@web.de> wrote: >> Well, I don't know where the ymid[...] values come from. If you can >> guarantee that ymid[track_num] - ymid[track_num-1] > 50 at some point >> you could reschedule loadFile() from within loadFile() and return >> immediat

Re: tkinter: loading file before entering mainloop

2009-03-15 Thread Peter Billam
On 2009-03-14, Peter Otten <__pete...@web.de> wrote: > Well, I don't know where the ymid[...] values come from. If you can > guarantee that ymid[track_num] - ymid[track_num-1] > 50 at some point > you could reschedule loadFile() from within loadFile() and return > immediately as long as that condit

Re: tkinter: loading file before entering mainloop

2009-03-14 Thread Peter Otten
Peter Billam wrote: >> Peter Billam wrote: >> window = MainWindow(application) >> if (len(sys.argv) > 1) and os.path.exists(sys.argv[1]): >> window.loadFile(sys.argv[1]) >> application.mainloop() >> File "./midimix", line 465, in loadFile >> space0.grid(row=grid_row, >> pady

Re: tkinter: loading file before entering mainloop

2009-03-14 Thread Peter Billam
> Peter Billam wrote: > window = MainWindow(application) > if (len(sys.argv) > 1) and os.path.exists(sys.argv[1]): > window.loadFile(sys.argv[1]) > application.mainloop() > File "./midimix", line 465, in loadFile > space0.grid(row=grid_row, > pady=round(0.5*(ymid[track_num]-y

Re: tkinter: loading file before entering mainloop

2009-03-14 Thread Peter Otten
Peter Billam wrote: > I've got this tkinter program which allows you to load a file with > File/LoadFile or Ctrl-L or from the Alt-F menu, as usual. But I'd > also like to be able to invoke it with: > shellprompt> midimix x.mid > and have it invoke its usual loadFile method on x.mid > But with t

tkinter: loading file before entering mainloop

2009-03-13 Thread Peter Billam
Greetings, I've got this tkinter program which allows you to load a file with File/LoadFile or Ctrl-L or from the Alt-F menu, as usual. But I'd also like to be able to invoke it with: shellprompt> midimix x.mid and have it invoke its usual loadFile method on x.mid But with the top-level code: