Python Forum
Text after push button
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text after push button
#13
(Jul-05-2019, 02:44 PM)Yoriz Wrote: The only button in the code shown is
b = button = tk.Button(master1,image=image2, height=80, width=160,background="red",font="0",bd=10,fg="black",command= text_1_2)
master3 has no button

thank you Yoriz,i delete the line with buttons and all is ok,i have only one wrong,:
"name finished is not defined"

this is a new kode,all work thanks to you,it nave only one error,: master3.after(1000,finished)
NameError: name 'finished' is not defined,
can you see the code,it have and another errors.

import tkinter as tk
from tkinter import *
import smtplib
from tkinter import Tk, Toplevel, Button
import RPi.GPIO as GPIO
import time
import tkinter.ttk as ttk
from tkinter.ttk import Progressbar, Style, Button
 
 
 
 
master= Tk()
 
master1 =Toplevel()
master3 =Toplevel()
 
 
##################################right
 
master1.minsize(150,150+170+170)
master1.geometry("185x1000+0+0")
master1.configure(background="black",)
master1.title("2")
master1.overrideredirect(True)
#################################left
 
 
master3.minsize(900,0+0+0)
master3.geometry("100x80+180+920")
master3.configure(background="red",)
master3.title("КАФЕ АВТОМАТ 1")
master3.overrideredirect(True)
#################################
 
 
master3.label = tk.Label(master3, text='this is OK')
master3.label.pack()
 
 
 
def text_1_2():
    b2()
    nadpisok()
   ##########################
 
     
def nadpisok():
    master3.label['text'] = 'please wait'
    master3.after(39000,delayed_textok)
    
     
def delayed_textok():
    master3.label['text'] = 'this is OK'
    master3.after(1000,finished)
 
      
 
 
###########################################
GPIO.setwarnings(False)
 
    
#########################################
def b2():
        GPIO.setmode(GPIO.BCM)
        RELAIS_2_GPIO = 10
        GPIO.setup(RELAIS_2_GPIO, GPIO.OUT)
        GPIO.output(RELAIS_2_GPIO, GPIO.HIGH)
        time.sleep(0.35)
        GPIO.output(RELAIS_2_GPIO, GPIO.LOW)
        time.sleep(0.35)
#########################################
 
 
image2 = tk.PhotoImage(file="")
b = button = tk.Button(master1,image=image2, height=80, width=160,background="red",font="0",bd=10,fg="black",command= text_1_2)
b.place(x = 0, y = 600)
label2=Label(master1,text="",height=0, width=0,bg="#100C19",font="Times 13 underline",fg="white",relief="solid",bd=0).place(x=0,y=200)
#########################
 
master.mainloop()
GPIO.cleanup()
Reply


Messages In This Thread
Text after push button - by chano - Jul-02-2019, 09:09 AM
RE: Text after push button - by Denni - Jul-02-2019, 01:35 PM
RE: Text after push button - by chano - Jul-02-2019, 03:01 PM
RE: Text after push button - by Denni - Jul-02-2019, 03:30 PM
RE: Text after push button - by chano - Jul-03-2019, 10:09 AM
RE: Text after push button - by Yoriz - Jul-02-2019, 05:50 PM
RE: Text after push button - by chano - Jul-04-2019, 06:43 AM
RE: Text after push button - by chano - Jul-05-2019, 09:30 AM
RE: Text after push button - by chano - Jul-05-2019, 02:02 PM
RE: Text after push button - by Yoriz - Jul-05-2019, 02:11 PM
RE: Text after push button - by chano - Jul-05-2019, 02:37 PM
RE: Text after push button - by Yoriz - Jul-05-2019, 02:44 PM
RE: Text after push button - by chano - Jul-05-2019, 02:58 PM
RE: Text after push button - by Yoriz - Jul-05-2019, 03:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  tkinter - touchscreen, push the button like click the mouse John64 5 879 Jan-06-2024, 03:45 PM
Last Post: deanhystad
  Centering and adding a push button to a grid window, TKinter Edward_ 15 4,919 May-25-2023, 07:37 PM
Last Post: deanhystad
  Can't change the colour of Tk button text Pilover 6 14,840 Nov-15-2022, 10:11 PM
Last Post: woooee
  [Tkinter] Make my button text update? Skata100 1 2,046 Aug-07-2021, 05:37 AM
Last Post: deanhystad
  Updating button text based upon different variable values knoxvilles_joker 0 2,249 Apr-18-2021, 04:13 AM
Last Post: knoxvilles_joker
  tkinter | Button color text on Click Maryan 2 3,405 Oct-09-2020, 08:56 PM
Last Post: Maryan
  How to make button text bold in Tkinter? scratchmyhead 2 12,103 May-16-2020, 02:53 AM
Last Post: scratchmyhead
  [Tkinter] Text Button - How Do I Reduce The Margin? vman44 6 11,309 Apr-27-2020, 10:48 PM
Last Post: Larz60+
  [PyQt] Push Button issue gvin47 8 4,361 Apr-18-2020, 05:39 PM
Last Post: deanhystad
  [PySimpleGui] How to alter mouse click button of a standard submit button? skyerosebud 3 5,043 Jul-21-2019, 06:02 PM
Last Post: FullOfHelp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020