Python Forum
popup message box code runs in Windows, but not in Linux
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
popup message box code runs in Windows, but not in Linux
#5
Okay, thanks.  I'll take note of that.  It's still not running from the command line.  The latest attempt went as follows:

thomas@thomas-HP-Compaq-6200-Pro-SFF-PC:~/Documents/python_work/GUIs/thenewboston$ python buckymessagebox.py
Traceback (most recent call last):
  File "buckymessagebox.py", line 1, in <module>
    from tkinter import *
ImportError: No module named tkinter
thomas@thomas-HP-Compaq-6200-Pro-SFF-PC:~/Documents/python_work/GUIs/thenewboston$ 
I wonder if tkinter has to be on whatever the Linux equivalent of the path is.  I remember having to put things on the path back in my MS DOS days. 

As for the message box commands, I wonder if for any Linux version, I have to code in something that tells the message box to display forward.  Those message boxes are running, but the first one is always back behind.  I did a little more coding, adding more message boxes just for practice:

from tkinter import *

import tkinter.messagebox      ### Pull in ability to make message boxes

root = Tk()

tkinter.messagebox.showinfo('Window Title', 'Monkeys can live up to 300 years.')

answer = tkinter.messagebox.askquestion('Question 1', 'Do you like silly faces?')

if answer == 'yes':
    tkinter.messagebox.showinfo('Really', 'Here ya go 8===D~ ')
    # print(' 8===D~ ')
elif answer == 'no':
    tkinter.messagebox.showinfo('Really', 'You sure are boring')

newanswer = tkinter.messagebox.askquestion('Question 2', 'Are you a goofball?')

if newanswer == 'yes':
    tkinter.messagebox.showinfo('Really', 'That is awesome.  Enjoy')
elif newanswer == 'no':
    tkinter.messagebox.showinfo('Really', 'Yawn, why not live a little?')
else:
    tkinter.messagebox.showinfo('Really', 'Yeah, whatever.')

root.mainloop()
The first one, the one that reads "Monkeys can live up to 300 years" is always back behind.  I have to find it in the Kubuntu task bar and click on it to bring it forward.  Once that is done, all the others are then at the front where they should be.  I can't let that behavior be in the final version of an application.  If the user ran it, he might not realize that there was a message box back behind that was asking a question. 

Maybe there's some way to tell a message box "run in the foreground"?
Reply


Messages In This Thread
RE: popup message box code runs in Windows, but not in Linux - by Luke_Drillbrain - May-02-2017, 05:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Hover over highlighted text and open popup window DrakeSoft 2 1,591 Oct-29-2022, 04:30 PM
Last Post: DrakeSoft
  POPUP on widget Entry taratata2020 4 3,833 Mar-10-2020, 05:04 PM
Last Post: taratata2020
  [WxPython] How to show remove button at the right side of the hovering item of a combobox popup? indrajitmajumdar 0 2,547 Mar-28-2019, 11:24 AM
Last Post: indrajitmajumdar
  [Tkinter] [SOLVED] Create per button popup menu py2.7 AceScottie 5 6,261 May-31-2018, 12:39 AM
Last Post: AceScottie
  Code fails on Mac, works on Windows and Raspberry Pi eugenedakin 4 4,062 May-30-2018, 03:49 AM
Last Post: eugenedakin
  [PyQt] source code is not running in REDHAT 7 linux platform shridhara 0 2,143 May-23-2018, 07:58 AM
Last Post: shridhara
  Please advice Linux library - tray icon, popup windows, ICQ/Skype style etc ramendik 5 4,133 Dec-03-2017, 04:35 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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