Python Tkinter : window for help

Post here if you need help with creating a Graphical User Interface in Python.

Python Tkinter : window for help

Postby mariana.visa » Wed Nov 27, 2013 4:58 pm

Hello everyone,

I've implemented an application using Tkinter.
And now I want to add in the menu the Help option which will lead to :
-About
-Description

When About is pressed I want a small window to be opened where is loaded a test written in a file
What do you recommend that window to be ?
- Popup
-tkMessageBox

I mention that the text can be big , therefore I could need a scroll too.
Last edited by stranac on Wed Nov 27, 2013 5:08 pm, edited 1 time in total.
Reason: First post lock.
mariana.visa
 
Posts: 2
Joined: Wed Nov 27, 2013 4:51 pm

Re: Python Tkinter : window for help

Postby Yoriz » Wed Nov 27, 2013 5:44 pm

A frame with a text box.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 774
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Python Tkinter : window for help

Postby mariana.visa » Wed Nov 27, 2013 5:56 pm

Using a frame will make to be displayed the close, minimise and maximise buttons. And I would#t prefer that . As far as I know those buttons can#t be deactivated. Thank you
mariana.visa
 
Posts: 2
Joined: Wed Nov 27, 2013 4:51 pm

Re: Python Tkinter : window for help

Postby Yoriz » Wed Nov 27, 2013 6:25 pm

In wxpython you can choose what you want to appear on a frame by setting its style so you can turn off close, minimise and maximise buttons, i dont know about tkinter hopefully you can do a similar thing.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 774
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: Python Tkinter : window for help

Postby octopez » Thu Nov 28, 2013 9:13 am

Found this somewhere on the internets:
Code: Select all
import tkMessageBox
from Tkinter import *

class App():
    def __init__(self):
        self.root = Tk()
        self.root.overrideredirect(1)
        self.frame = Frame(self.root, width=320, height=200,
                           borderwidth=2, relief=RAISED)
        self.frame.pack_propagate(False)
        self.frame.pack()
        self.bQuit = Button(self.frame, text="Quit",
                            command=self.root.quit)
        self.bQuit.pack(pady=20)
        self.bHello = Button(self.frame, text="Hello",
                             command=self.hello)
        self.bHello.pack(pady=20)

    def hello(self):
        tkMessageBox.showinfo("Popup", "Hello!")

app = App()
app.root.mainloop()

This creates a borderless window at least on MS Windows OS. Keep in mind, that this must not apply on other OSs as well, as e.g. on Linux the window manager is responsible for window borders and decorations, NOT the GUI toolkit.
Tested the above code on MS Win7, 64 bit and worked.
Greetings and all the best,
Octopez

Strange women lying in ponds distributing swords is no basis for a system of government.
User avatar
octopez
 
Posts: 25
Joined: Fri Feb 08, 2013 11:26 pm


Return to GUI

Who is online

Users browsing this forum: No registered users and 1 guest

cron