ttk

how get no border effect in tkinter ttk?

限于喜欢 提交于 2019-12-12 05:36:52
问题 To get button no border effect in tkinter tk I used to set borderwidth=0 . Button will merge into background. But I can't get same effect in tkinter ttk. I set borderwidth=0 in style. Button always have borderwidth. I don't know why? 回答1: What you want can be achieved by setting the button relief to flat or borderwidth to 0 using a ttk style. However, some ttk themes don't take into account these style settings, and one of them is the default theme in Windows. Setting the theme to 'clam' or

Tkinter command ignores some lines

六眼飞鱼酱① 提交于 2019-12-11 14:26:27
问题 The code below createds a Tkinter root window with a button. The button is bound to a simple function which should display a progressbar widget momentarily. Whilst the print statements run as expected, the progress bar is never displayed. Any clues? from Tkinter import * import ttk from time import sleep root = Tk() def foo(): print 'starting...' pb = ttk.Progressbar(root, mode='indeterminate') pb.pack() sleep(5) print 'stopping...' pb.destroy() ttk.Button(root, text="Run", command=foo).pack(

Using an tkinter image canvas in a loop

情到浓时终转凉″ 提交于 2019-12-11 14:19:31
问题 Hello i recently started studying tkinter and decided to pick up this block breaker game and study/modify it so the problem occur in the following lines : blocks = [] block.xLoc = 50 block.yLoc = 50 block.xsize = 40 block.ysize = 30 for x in range(4): for y in range(20): blockC = PhotoImage(file = "block.png") blockID = canvas.create_image(block.xLoc,block.yLoc,image=blockC) canvas.grid() blocks.append(blockID) block.xLoc += 40 block.yLoc += 30 block.xLoc = 50 i wanna have multiple image

How do I make a color selection scale in Tkinter?

霸气de小男生 提交于 2019-12-11 11:18:25
问题 I'm trying to create a color selection scale for a Tkinter application. I'm not interested in the tkinter.colorchooser module or separate scales for each RGB channel. I need a single scale like the color slider in Photoshop. What I currently have is a vertical scale widget with RGB integer values going from 0 ( #000 ) to 16777215 ( #FFF ). The problem is that using a range of RGB integers results in a very odd sequence of colors—the selection doesn't go from red to pink to blue, etc. as in

How to have tabs of a ttk Notebook in different rows?

北城余情 提交于 2019-12-11 10:54:55
问题 In the below program i have many tabs in a single notebook page. when the number of tabs increases the look changes. So how to put the tabs in different rows As in attached image, I have many tabs in a single row, but I want some tabs say from JJJJ in a below row. How to set tabs in different row also how to give different colors to tab(highlight the tab) when selected? title = 'Trial Tool window' import sys sys.path[:0] = ['../../..'] import Tkinter import Pmw class MyButton(Tkinter.Button):

ttk Opening Secondary Window when Applying Style

心已入冬 提交于 2019-12-11 08:54:59
问题 Here is my code from Tkinter import * import ttk, tkMessageBox import os font = ("Avenir", 24) b = ttk.Style() b.configure('TButton', font=font) class LoginScreen(Tk): def __init__(self, *args, **kwargs): Tk.__init__(self, *args, **kwargs) container = Frame(self) container.pack(side=TOP, fill=BOTH, expand=True) self.frames = {} for F in (Login, Register): frame = F(container, self) self.frames[F] = frame frame.grid(row=0, column=0, sticky='nsew') self.show_frame(Login) def show_frame(self,

I want my ttk.treeview to have alternating colours

匆匆过客 提交于 2019-12-11 07:23:32
问题 I want my ttl.treeview table to have an alternating pattern of colours and I tried to add tags and make the background of each odd row distinct by using the tag_configure method, but I haven't been able. Every row is a row taken from a db table that I want to show. I also tried to do so in a little and separate program, but it hasn't been effective either. def show(self, row, column, rowspan): self.row = row self.column = column self.rowspan = rowspan global FondoBase self.Tabla = ttk

How to align these checkbuttons in tkinter?

元气小坏坏 提交于 2019-12-11 04:45:27
问题 I want to ask, how to align these few checkbuttons in tkinter. I m using ttk. This is my code button_frame=Frame(main, style='TFrame') checks_frame=Frame(main, style='TFrame') output_frame=Frame(main, style='TFrame') start_button=Button(button_frame, text='START', command=lambda: _thread.start_new_thread(suspend_processes, ()), state=NORMAL, style='TButton') stop_button=Button(button_frame, text='STOP', command=lambda: restore_all_processes(False, False), state=DISABLED, style='TButton')

Why do the `tkinter.ttk.Notebook` tabs get thinner and thinner?

怎甘沉沦 提交于 2019-12-11 04:43:12
问题 I am using a tkinter.ttk.Notebook and the tabs seem to get thinner with time. How do I overcome this? Is there a possibility to specify a uniform width for each tab? I use this code to add a tab: notebook.add(game.frame, text=game.name, underline=0, sticky=tkinter.NS) 回答1: I don't know if it's possible to set a uniform width for each tab, but it seems that the tab width problem is style dependent: with style "alt" the tab name SEVEN is partially hidden: with style "clam" it is fully visible:

Callback and n Entry box widgets not functioning Tkinter

て烟熏妆下的殇ゞ 提交于 2019-12-11 04:40:03
问题 In the code below I need to return all values returned (but for each row separately) but I have tried lambda and failed and I'm not getting anywhere AGAIN. I also have the callback definition where it previously worked and when I click in a box, it deletes the grey writing so I can continue to input in black. If possible I would like to add the value return for the entry box at the end of my callback function rather than keeping 'numberwritten' and 'callback'..Is this possible? The number of