Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
2 answers
113 views

Title not showing properly using Tkinter GUIs in Python

I am currently trying to learn doing simple GUIs with Python using the package Tkinter. I wrote this program for a To Do List: import tkinter import tkinter.messagebox import pickle root = tkinter....
Arctic_Skill's user avatar
2 votes
2 answers
103 views

I wanna add a small buttons bar down the note and when i do buttons dont appear why?

am trying to make a notepad app and I wanted to add a small bar at the end with buttons to do custom stuff but when I try to add a button it doesn't appear on the program what did I do wrong? here is ...
Real Swat's user avatar
0 votes
0 answers
44 views

Updating imagef on TK buttons, each time a button is pressed

I try to build a short of captha app that must run on desktop and emulated on Android, so far I have success with the example "simple calculator" that use TK and Buttons. I success to load ...
raghad1's user avatar
1 vote
2 answers
188 views

Error when using window button in tkinter

Here is my code for debugging: from tkinter import * window = Tk() b1 = window.button(window,text="Dark",command=window.configure(bg='black')) window.mainloop() I want to add a button to ...
Loves2Code's user avatar
0 votes
1 answer
945 views

How to store data from filedialog.askopenfilename?

I cant figure out how to store value from filedialog.askopenfilename. Now i saved the value to local variable but i want to work with this value later in other functions. I cant return the this value ...
GGGGGG's user avatar
  • 5
1 vote
2 answers
759 views

Exit Python Tkinter app cleanly while also using "wait_variable" function on a button in an "after" loop

I have a problem similar to this post: Exit program within a tkinter class My variation on the problem involves the wait_variable being used on a button to control "stepping forward" in an ...
kecklabs's user avatar
0 votes
1 answer
869 views

How can I remove an specific button in tkinter after creating various of them with the same function?

So I'm programming my first GUI with Tkinter for a project I have in mind and I'm having a lot of trouble with one essential step for this project. To summarize, I need to create a button that simply ...
javiloz1604's user avatar
1 vote
1 answer
393 views

How can I fix my button positions on python tkinter?

I want to fix the position of my two buttons like if I resize my window the buttons will remain in their positions. Or My buttons dynamically resize with the window size. I have positioned my buttons ...
Sadia Razzaq's user avatar
0 votes
1 answer
40 views

Is there a way to change a global value from inside a function?

I am currently working an a snake game, but I first want a settings window to show up.i used tkinter for this. In smaller projekts I just wrote all of the code into the pressButton function, but I ...
madcoder's user avatar
0 votes
1 answer
532 views

grey-out button when top level window is opened

Hey I am using Tkinter Python and I have a name entry. If an invalid name is entered it will come up with a error in a new window. I want the original window or button to be greyed out while this ...
Samuel Ogle's user avatar
1 vote
2 answers
2k views

Python tkinter how to zoom in widgets

My code: import tkinter as tk root = tk.Tk() for i in range(50): for j in range(50): tk.Button(height=1, width=2, bg='Blue').grid(row=j, column=i) root.mainloop() I can not see all of ...
justaquestion's user avatar
-1 votes
3 answers
4k views

How to add image in a button

This makes an image: import tkinter as tk from PIL import ImageTk, Image window = tk.Tk() window.geometry("960x540+480+200") load = Image.open("example.png") render = ImageTk....
yoav's user avatar
  • 322
0 votes
1 answer
208 views

Using self.pack and self.grid works without classes, but fails with them

So I tried to use Tkinter Button Alignment in Grid to make a toolbar, but the difference is im using classes. So while they use frame.pack and button.grid, i get the error of using both pack and grid. ...
Frederick Reynolds's user avatar
1 vote
1 answer
203 views

Making a list of buttons in using perl TK based ona loop

I have a loop of items in an array that looks like this: ("Hugo", "Gilbert", "Linda", "Katrina") What I am trying to do is design a perl Tk script that allows me to create a number of radio buttons ...
jms1980's user avatar
  • 1,075
1 vote
2 answers
1k views

Tcl/Tk absolutely simple Hello World example fails - invalid command name "button"

I was trying to follow the tutorials/code-snippets on the wiki Tcl lang page. But unfortunately, no matter, if I write the following code in a text file hello_world.tcl, as shown below: #! /usr/...
Duck Dodgers's user avatar
  • 3,451
0 votes
1 answer
1k views

Tkinter Button Function Control by MessageBox

The code below shows part of my program and the issue im facing. def checkAnswer(): mainAnswer = answer01.get() if len(mainAnswer) == 0: messagebox.showwarning(message='Please answer the question!...
wojtas's user avatar
  • 3
-1 votes
1 answer
55 views

Python TkInter Buttons Programming

I would like someone to tell me what is wrong with my following code. I want the code to provide a window with 2 buttons one saying 50% and the other 75%. import tkinter as tk class Application(tk....
sakis zero's user avatar
1 vote
2 answers
3k views

Changing rectangle color on click in Python using Tk

I'm trying to get a Tk rectangle created on a canvas to change its color when clicked. Right now, no color change happens when the rectangle is clicked. What do I need to be doing differently? This ...
K. Shores's user avatar
  • 1,005
2 votes
4 answers
466 views

Tkinter callback

I have a Tkinter problem with callback in button1. When I click button1 I want the SearchIP method to get called, but I am getting this error message: File "C:\Python27\lib\lib-tk\Tkinter.py", line ...
Kero's user avatar
  • 1,944
0 votes
1 answer
176 views

How can I make the button text change, from text to an empty name with a delay?

I'm using tkinter library for the GUI. Basically I'm creating 4 buttons using a for loop, each having a random number as their text. Now I got stuck when trying to implement a method which allows the ...
Monroy's user avatar
  • 430
0 votes
1 answer
1k views

Can't make a tk image Button with IPython Notebook

I'm using an IPython notebook to create a Tk application in Python. I can make a button with a text label: %matplotlib tk import tkinter as tk root = tk.Tk() button = tk.Button(root, text = '...
John Conery's user avatar
0 votes
2 answers
1k views

Animated GIF in tcl/tk button widget

I have a Tcl/tk application where user had to be notified from 10 days earlier of license expire. I want to implement a animated warning image in a button in right corner of toolbar to notify the same....
Codename_DJ's user avatar
1 vote
1 answer
381 views

How to shade text color in TclTk

I implemented a button in TclTk with the text "Click". What I have to do is to write the text with different shades of green. Is there anyway to make the text' color of a button to be green shaded?
Ionut's user avatar
  • 833
0 votes
1 answer
785 views

How to change label's text font in tcltk

I have a GUI with a label and a button. When I press the button a new window comes up were from I have to choose the font. This part I managed to do it. It is on tcltk help site a code witch helped ...
Ionut's user avatar
  • 833
1 vote
1 answer
14k views

How to exit from Python using a Tkinter Button?

To start off, let me show you my code: import Tkinter import tkMessageBox import time import sys def endProgam(): raise SystemExit sys.exit() top = Tkinter.Tk() B = Tkinter.Button(top, text ...
said's user avatar
  • 476
-1 votes
1 answer
557 views

Setting a button's clicked state in TCL

In TCL, how can I programmatically set the 'clicked' state of a button? So for example, I have two latched buttons. When I latch button one to 'on', I want button two to also latch 'on'. In something ...
user2725455's user avatar
0 votes
1 answer
76 views

delete a former label tk python

im developing an application with Tkinter module using python, but i have an issue i cant solve. the application takes info from the user and then place this informtion and place it on the screen (...
Jonatan's user avatar
  • 29
0 votes
1 answer
462 views

How to use scrollbar widget function in another Tkinter class and bind it to buttons

I've created a Tkinter class, Ext() with a scrollbar for any text in the variabel self.text in the create_scrollbar() method. I want to use this method by binding it to Buttons in the class ...
user1749431's user avatar
0 votes
2 answers
134 views

Tcl configure -background of button fails

I have the following proc which changes the select file button colour depending on if the current path in the entrybox exists or not. The first if loop works, for the second I get "invalid command ...
Lumpi's user avatar
  • 2,801
0 votes
1 answer
97 views

Creating a CAPS button on Tcl Tk

I am needed to create a window with an input line and a single button that will work like this: The button is going to be labeled "CAPS" and when it is pressed, the text on the input line will turn ...
Philip Xenos's user avatar
0 votes
2 answers
794 views

How can I make Tcl/Tk buttons behave like radiobuttons?

According to the ActiveTcl 8.5 Documentation: ttk::radiobutton widgets are used in groups to show or change a set of mutually-exclusive options. Radiobuttons are linked to a Tcl variable, and have an ...
milarepa's user avatar
  • 759
5 votes
2 answers
3k views

Tcl/tk Button - How I can pass a variable on the command option?

I have a problem passing variables on the command option, for example: package require Tk wm withdraw . destroy .button toplevel .button # button.0: puts 0 set count 0 button .button.$count -text $...
milarepa's user avatar
  • 759
2 votes
1 answer
2k views

Python Tk - Dynamically change button, defined in function, on click

I am new to making GUIs with Python and what I am trying to do should be pretty simple. Essentially, I have a dialog class that I use to instantiate a dialog in my program. One of the things on this ...
Fincher's user avatar
  • 100
5 votes
4 answers
817 views

Python subprocess killing

I have problem killing sub processes. The following piece of code is used for creating the sub process- while(not myQueue.empty()): p=Popen(myQueue.get(),shell=True,stdin=PIPE,stderr=PIPE) ...
Alphaceph's user avatar
  • 115
1 vote
1 answer
1k views

Python Tk Multiple Buttons Creation Problem

I'm creating ten buttons and the button texts are labelled 1 to 10. The following code creates 10 buttons and labels correctly. But it's printing 9 as the output for all the buttons. What I expect it ...
Alphaceph's user avatar
  • 115
1 vote
1 answer
3k views

Tcl/Tk: entry button - getting values into entry without passing entry

I am implementing an entry and button with the following functionality. On clicking the button I will get a list of check buttons. After selecting check buttons they should get reflected in the entry. ...
Anand's user avatar
  • 1,122
1 vote
2 answers
764 views

Ruby/Tk: how to get smaller button widget with image

I'm coding on Tk 8.5.9 from ActiveTcl on Ruby 1.8.7 on a Mac OS X 10.6. To meet my application requirements I need to make the button widgets as small as the gif image but I am not able to. I have ...
Elias's user avatar
  • 21
2 votes
2 answers
6k views

How to change the font and font size in ttk::button (themed widgets)?

How do you change the font and font size in the themed button widget (ttk::button)? ttk::button .x.buttonTEST -text "TEST" -font ?? # the -font option is not valid with ttk::button
justin's user avatar
  • 243