Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:13:57+00:00 2026-06-11T17:13:57+00:00

Python ttk gui creating is easy and has mostly native look and feel (win7).

  • 0

Python ttk gui creating is easy and has mostly native look and feel (win7). I am having a slight problem, though:

I would like to have a frame that looks like ttk.LabelFrame but without label. Just omitting the text option will leave an ugly gap.

Also I can not get the ttk.Frame border to look like LabelFrame. Is there an elegant way of doing this? Bonus karma if this works on all/most windows versions above xp.

Maybe it works with styles but the style LabelFrame properties seem mostly empty (style.element_options(“border.relief”)). Maybe I am looking in the wrong place.

edit:

try:  # python 3
    from tkinter import *  # from ... import * is bad
    from tkinter.ttk import *
except:
    from Tkinter import *
    from ttk import *

t = Tcl().eval
print("tcl version: " + str(t("info patchlevel")))
print("TkVersion: " + str(TkVersion))

root = Tk()

lF = LabelFrame(root, text=None)
lF.grid()
b = Button(lF, text='gonzo')
b.grid()

f = Frame(root, relief="groove") #GROOVE)
f.grid()
b2 = Button(f, text='gonzo')
b2.grid()

f2 = Frame(root, relief=GROOVE, borderwidth=2)
f2.grid()
b3 = Button(f2, text='gonzo')
b3.grid()

mainloop()

output on win7 with freshly downloaded python 3.2.3:

tcl version: 8.5.9

TkVersion: 8.5

output

There is python 2.6.6 installed on this machine, too (same problem). Each installation seems to be using the correct tk/tcl, though.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:13:58+00:00Added an answer on June 11, 2026 at 5:13 pm

    OK, seems like one solution to getting the LabelFrame without the gap is to use an empty widget in place of the text. So, modifying the first part of your example slightly:

    # don't do the 'from tkinter import *' thing to avoid namespace clashes
    import tkinter   # assuming Python 3 for simplicity's sake
    import tkinter.ttk as ttk 
    
    root = tkinter.Tk()
    
    f = tkinter.Frame(relief='flat')
    lF = ttk.LabelFrame(root, labelwidget=f, borderwidth=4)
    lF.grid()
    b = ttk.Button(lF, text='gonzo')
    b.grid()
    
    root.mainloop()
    

    Seems to work for me with the regular Win7 theme.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Python version: 3.1.1) I am having a strange problem with StringVar in tkinter. While
Python has a lot of convenient data structures (lists, tuples, dicts, sets, etc) which
python newbie here. I'm writing the code to control an experiment that has multiple
Python has the idea of metaclasses that, if I understand correctly, allow you to
So I wrote a little script in python that brings up a gui with
I'm switching over a small app (Python 2.7.3/32 on Win 7/64) to use ttk
Python 2.x has a great function called dateutil.parser which turns an ISO8601 formatted date
Python has this wonderful way of handling string substitutions using dictionaries: >>> 'The %(site)s
I'm attempting to add an item to a ttk.Treeview instance in my Python script
Python's module 'random' has a function random.choice random.choice(seq) Return a random element from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.