本文整理汇总了Python中Tkinter.Frame.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Frame.__init__方法的具体用法?Python Frame.__init__怎么用?Python Frame.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tkinter.Frame
的用法示例。
在下文中一共展示了Frame.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, master, image, name, enhancer, lo, hi):
Frame.__init__(self, master)
# set up the image
self.tkim = ImageTk.PhotoImage(image.mode, image.size)
self.enhancer = enhancer(image)
self.update("1.0") # normalize
# image window
Label(self, image=self.tkim).pack()
# scale
s = Scale(self, label=name, orient=HORIZONTAL,
from_=lo, to=hi, resolution=0.01,
command=self.update)
s.set(self.value)
s.pack()
示例2: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, root, horizontal_factor = 2, vertical_factor=2):
self._active_area = None
if isinstance(horizontal_factor, int):
self.horizontal_factor = horizontal_factor
else:
raise Exception("Vertical factor must be an integer.")
if isinstance(vertical_factor, int):
self.vertical_factor = vertical_factor
else:
raise Exception("Horizontal factor must be an integer.")
if OS == "Linux" :
root.bind_all('<4>', self._on_mousewheel, add='+')
root.bind_all('<5>', self._on_mousewheel, add='+')
else:
# Windows and MacOS
root.bind_all("<MouseWheel>", self._on_mousewheel, add='+')
示例3: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, w, ticks, config_function, duration=1, interval_time=None, easing_function=None, start_value=0, end_value=1, callback=None):
self._w = w
self._tick = 0
self._total_ticks = float(ticks)
if easing_function is None:
self._easing_function = lambda x: x
self._duration = duration
if interval_time:
self._interval_time = int(interval_time * 1000)
else:
self._interval_time = int(duration * 1000 / self._total_ticks)
self._start_value = start_value
self._end_value = end_value
self._interval_value = end_value - start_value
self._config_function = config_function
self._callback = callback
示例4: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, master, ask_dialog = askopenfilename, width=30, **dialog_options):
Frame.__init__(self, master)
self._file_autocomplete = Combobox_Autocomplete(self, width=width, autocomplete_function=self._autocomplete_function)
self._file_autocomplete.pack(side=LEFT)
button_size = self._file_autocomplete.winfo_reqheight()
button_frame = Frame(self, height=button_size, width=button_size)
button_frame.pack(side=LEFT, padx=(3,0))
button_frame.pack_propagate(0)
Button(button_frame, text="...", command=self._open_dialog).pack(fill=BOTH, expand=True)
self._ask_dialog = ask_dialog
self._dialog_options = dialog_options
示例5: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self,parent,stdoutq):
Frame.__init__(self,parent)
self.parent=parent
self.width=750
self.height=450
self.title=ximaexport.__version__
self.stdoutq=stdoutq
self.initUI()
self.hasdb=False
self.hasout=False
self.exit=False
self.path_frame=self.addPathFrame()
self.action_frame=self.addActionFrame()
self.message_frame=self.addMessageFrame()
self.printStr()
self.stateq=Queue.Queue()
示例6: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self,parent,stdoutq):
Frame.__init__(self,parent)
self.parent=parent
self.width=850
self.height=650
self.title=menotexport.__version__
self.stdoutq=stdoutq
self.initUI()
self.hasdb=False
self.hasout=False
self.hasaction=False
self.exit=False
self.path_frame=self.addPathFrame()
self.action_frame=self.addActionFrame()
self.message_frame=self.addMessageFrame()
self.printStr()
self.stateq=Queue.Queue()
#self.workproc=Pool(1)
示例7: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, root, horizontal_factor=2, vertical_factor=2):
self._active_area = None
if isinstance(horizontal_factor, int):
self.horizontal_factor = horizontal_factor
else:
raise Exception("Vertical factor must be an integer.")
if isinstance(vertical_factor, int):
self.vertical_factor = vertical_factor
else:
raise Exception("Horizontal factor must be an integer.")
if OS == "Linux":
root.bind_all('<4>', self._on_mousewheel, add='+')
root.bind_all('<5>', self._on_mousewheel, add='+')
else:
# Windows and MacOS
root.bind_all("<MouseWheel>", self._on_mousewheel, add='+')
示例8: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, db=DB, conf=CONF, **shnargs):
super(KivySearchBox, self).__init__(**shnargs)
#Widget.__init__(self, **shnargs)
self.index=DriveIndex(db, conf)
self.Plat=Platform()
self.start= self.Plat.start_func()
self.query=''
#self.ids.result_view.data=[{'text': 'oh boy'}]
#self.data=ObjectProperty(None)
self._keyboard=window.Window.request_keyboard(self._other_kb_function, self)
self._keyboard.bind(on_key_down=self._keyboard_events)
separator='*'.encode(ENC)
if not self.index.findex: # change to a FileIndex api call (_findex)
self.ids.result_view.data.append({'text': 'No cache database found. ' + 'Hit F5 to generate database'})
else:
self.ids.result_view.data.append({'text': 'Type to search. [F5 - Refresh Database]'})
#a=WindowBase()
#WindowBase.maximize(a)
#window.Window.maximized=True
示例9: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__( self, parent=None, bg = 'white', gheight=200, gwidth=500,
barwidth=10, ymax=3.5,):
Frame.__init__( self, parent )
self.bg = bg
self.gheight = gheight
self.gwidth = gwidth
self.barwidth = barwidth
self.ymax = float( ymax )
self.xpos = 0
# Create everything
self.title, self.scale, self.graph = self.createWidgets()
self.updateScrollRegions()
self.yview( 'moveto', '1.0' )
示例10: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, parent, terrain):
"""Make self child of a TK parent, then initialize own UI.
Args:
parent (TK): Parent to attach self to.
terrain (Terrain): Terrain to display.
"""
Frame.__init__(self, parent)
self.terrain = terrain
self.parent = parent
self.init_ui()
示例11: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, master, width=0, height=0, family=None, size=None,*args, **kwargs):
Frame.__init__(self, master, width = width, height= height)
self.pack_propagate(False)
self._min_width = width
self._min_height = height
self._textarea = Text(self, *args, **kwargs)
self._textarea.pack(expand=True, fill='both')
if family != None and size != None:
self._font = tkFont.Font(family=family,size=size)
else:
self._font = tkFont.Font(family=self._textarea.cget("font"))
self._textarea.config(font=self._font)
# I want to insert a tag just in front of the class tag
# It's not necesseary to guive to this tag extra priority including it at the beginning
# For this reason I am making this search
self._autoresize_text_tag = "autoresize_text_"+str(id(self))
list_of_bind_tags = list(self._textarea.bindtags())
list_of_bind_tags.insert(list_of_bind_tags.index('Text'), self._autoresize_text_tag)
self._textarea.bindtags(tuple(list_of_bind_tags))
self._textarea.bind_class(self._autoresize_text_tag, "<KeyPress>",self._on_keypress)
示例12: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, master, color="gray", size=60, sashpad=2, disallow_dragging=False, on_click=None, image=None, cursor=None, opaqueresize=True):
Tk_PanedWindow.__init__(self, master, showhandle = False, orient=self.ORIENT, sashpad=sashpad, opaqueresize=opaqueresize)
self._active_sash = None
self._on_click = on_click
self._image = image
self._color = color
self._cursor = cursor
self._configure_callbacks = []
if not opaqueresize:
disallow_dragging = True
self._disallow_dragging = disallow_dragging
self._handle_list = []
self._list_of_panes = []
if self.ORIENT == VERTICAL:
self._width= size
self._height = 2*sashpad
else:
self._width = 2*sashpad
self._height= size
if opaqueresize:
self.bind('<Button-1>', self._on_mark_sash)
self.bind('<B1-Motion>', self._on_drag_sash)
self.bind('<ButtonRelease-1>', self._on_release)
示例13: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, master, bordercolor=None, borderleft=0, bordertop=0, borderright=0, borderbottom=0, interiorwidget=Frame, **kwargs):
Frame.__init__(self, master, background=bordercolor, bd=0, highlightthickness=0)
self.interior = interiorwidget(self, **kwargs)
self.interior.pack(padx=(borderleft, borderright), pady=(bordertop, borderbottom))
示例14: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, parent, title='', *args, **kw):
Frame.__init__(self, parent, *args, **kw)
self.title = title
示例15: __init__
# 需要导入模块: from Tkinter import Frame [as 别名]
# 或者: from Tkinter.Frame import __init__ [as 别名]
def __init__(self, master, text):
self._text = text
Frame.__init__(self, master, background=self.BACKGROUND, highlightbackground="red", borderwidth=1, relief=SOLID)
Label(self, text=text, background=self.BACKGROUND, foreground=self.FOREGROUND_LABEL).pack(side=LEFT, pady=(self.PADDING[1], self.PADDING[3]), padx=(self.PADDING[0],0))
self._close_IMG = PhotoImage(data="iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAFySURBVDiNpZM9juJAEIU/WxPY/EstQdICEYAQ+A5eX2CjDTgiMRfwzh4BmcAkTgAJiZZFsF7TbvAmeMUKZoKhouqnrqp+9V5bZVnyStgvVQNv94cgCN6EEAsApdQ8DEPzGQ5gVRRul5ae5wW2bbNarUKl1HeAZ3jV5N8LhBCL6XQaSCmdy+WC53lBFEVLgNlsFkgpHYDr9RpEUbQAfjxQMMagtSaOY8bjsTOZTHyAXq/nrNdrRqMRWuvnO1BKzTebzdIYEwwGAyeOY4bDYQ3glpMkSZ4kSaiUmj/s4H4P/X7f73a7td1uh2VZSCnZ7/fZdrt9v+f/QKEKrXWptaZqnuc5xpinhnlQQQjxTQjhnk4n2u02AFWulPqjlPr5oQqtVstvNBpumqa4rsvhcPhdliWdTqeepin1et0tisIHPlYhz3Ns2+Z4PGZZlv264X6z2aydz2eMMfcl/6sALG8TKIrivTLSE/xTFb5m5a/Gy7/xL3CL+6G7+HoOAAAAAElFTkSuQmCC")
Button(self, highlightthickness=0, borderwidth=0, background=self.BACKGROUND, activebackground=self.BACKGROUND, image=self._close_IMG, command=self.destroy).pack(side=LEFT, pady=(self.PADDING[1], self.PADDING[3]), padx=(self.LABEL_AND_BUTTON_SPACING,self.PADDING[2]))