Package pyraf :: Module newWindowHack
[hide private]
[frames] | no frames]

Module newWindowHack

source code

This module hacks tkSimpleDialog to make askstring() work even when the root window has been withdrawn.

w/o this hack, Python-2.4.3/Tk8.4 locks up for the following code: the dialog is created, but it is withdrawn just like the root window (!) so there is nothing to interact with and the system hangs.

import Tkinter

tk = Tkinter.Tk() tk.withdraw()

import tkSimpleDialog

tkSimpleDialog.askstring("window title", "question?")

Functions [hide private]
 
__init__(self, parent, title=None)
Initialize a dialog.
source code

Imports: tkSimpleDialog, getdouble, MULTIPLE, TypeType, mainloop, Canvas, AtSelLast, CodeType, TRUE, getboolean, LAST, BASELINE, BOTTOM, Wm, NUMERIC, Toplevel, DictProxyType, Pack, ObjectType, DictType, EXTENDED, OFF, ALL, CURRENT, CallWrapper, Scrollbar, ListType, MethodType, ModuleType, FIRST, ON, TracebackType, image_names, Text, YES, LambdaType, GROOVE, XRangeType, Scale, NORMAL, Misc, BUTT, Label, X, LabelFrame, ROUND, image_types, AtInsert, StringType, NONE, CENTER, FloatType, Spinbox, Radiobutton, Checkbutton, Grid, StringTypes, GeneratorType, Button, FLAT, END, VERTICAL, MITER, Widget, DISABLED, S, COMMAND, EllipsisType, W, ACTIVE, NSEW, EW, FrameType, TclVersion, CHORD, tkinter, Listbox, Image, BitmapImage, Event, RADIOBUTTON, Place, HIDDEN, PAGES, NoDefaultRoot, CHAR, SEPARATOR, BooleanType, HORIZONTAL, TclError, MOVETO, WORD, SUNKEN, NO, DictionaryType, NotImplementedType, READABLE, NE, CHECKBUTTON, Variable, NS, ANCHOR, NW, RAISED, DoubleVar, RIDGE, BooleanVar, Tributton, SOLID, N, CASCADE, SEL_FIRST, TkVersion, UNDERLINE, UNITS, TupleType, OptionMenu, LongType, SEL, FALSE, ClassType, Frame, SEL_LAST, SW, SINGLE, InstanceType, MemberDescriptorType, UnicodeType, LEFT, FunctionType, wantobjects, SE, EXCEPTION, FixTk, IntType, Menu, TOP, GetSetDescriptorType, DOTBOX, OUTSIDE, Tk, IntVar, AtSelFirst, UnboundMethodType, PanedWindow, INSERT, BuiltinMethodType, AtEnd, BROWSE, Tcl, BuiltinFunctionType, BaseWidget, ARC, SliceType, BEVEL, E, BOTH, PIESLICE, Message, FileType, sys, Y, Entry, PhotoImage, RIGHT, BufferType, Studbutton, INSIDE, Menubutton, WRITABLE, StringVar, PROJECTING, At, ComplexType, SCROLL, NoneType, getint


Function Details [hide private]

__init__(self, parent, title=None)
(Constructor)

source code 

Initialize a dialog.

Arguments:

parent -- a parent window (the application window)

title -- the dialog title