irfpy.util.tk
¶
Tkinter helper module.
Code author: Yoshifumi Futaana
- class irfpy.util.tk.ToplevelFrame(Frame_cls, master=None)[source]¶
Bases:
Toplevel
Using Tk.Frame class, instance Toplevel object.
+----- master (If given) -------------------+ | +----- ToplevelFrame -> Tk.Toplevel ----+ | | | +--- Frame -> Tk.Frame -----------+ | | | | | | | | | | +---------------------------------+ | | | +---------------------------------------+ | +-------------------------------------------+
Create the Toplevel derivative object from Frame derivative class
- Parameters:
Frame_cls – Derivative class of Tk.Frame. Not instance/object!!
# Usual way of instance Frame class MyFrame (Tk.Frame): def __init__(self, master=None): Tk.Frame.__init__(self, master) b = Tk.Button(self, text='OK') b.pack() # For usual usage tk = Tk.Tk() tp = Tk.Toplevel(tk) f = MyFrame(tp) f.pack() tk.mainloop() # For using this class tk = Tk.Tk() tp = ToplevelFrame(MyFrame, master=tk) tk.mainloop()
- irfpy.util.tk.functoplevel(frame_cls, master=None)[source]¶
Return the function that returns Toplevel instance from frame class.
This can be used as an argument for “command” option!
- class irfpy.util.tk.PyanaFrame(master=None)[source]¶
Bases:
Frame
Abstract frame for general use.
The frame is intended to specify paramters for plots.
Therefore, in the bottom, two buttons “Plot” and “Close” are placed by default.
You have to define the following three methods, at least
framename()
: Name of the framecreate_widget()
: All the widget, other than the buttonsgo()
: Command when “Plot” button is pressed.
See How to make a gui software for details.
Construct a frame widget with the parent MASTER.
Valid resource names: background, bd, bg, borderwidth, class, colormap, container, cursor, height, highlightbackground, highlightcolor, highlightthickness, relief, takefocus, visual, width.