Python Tkinter [Line seperator between buttons]Calling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Difference between __str__ and __repr__?How to read a file line-by-line into a list?Does Python have a string 'contains' substring method?
What prevents the use of a multi-segment ILS for non-straight approaches?
Intuition of generalized eigenvector.
Where did Heinlein say "Once you get to Earth orbit, you're halfway to anywhere in the Solar System"?
Should I stop contributing to retirement accounts?
Offered money to buy a house, seller is asking for more to cover gap between their listing and mortgage owed
Is "staff" singular or plural?
Should I outline or discovery write my stories?
Biological Blimps: Propulsion
Writing bit difficult equation in latex
I am looking for the correct translation of love for the phrase "in this sign love"
How can "mimic phobia" be cured or prevented?
Are the IPv6 address space and IPv4 address space completely disjoint?
Which one is correct as adjective “protruding” or “protruded”?
Does a 'pending' US visa application constitute a denial?
Loading commands from file
When a Cleric spontaneously casts a Cure Light Wounds spell, will a Pearl of Power recover the original spell or Cure Light Wounds?
What should you do when eye contact makes your subordinate uncomfortable?
GraphicsGrid with a Label for each Column and Row
Multiplicative persistence
Why is it that I can sometimes guess the next note?
Problem with TransformedDistribution
The IT department bottlenecks progress. How should I handle this?
If a character has darkvision, can they see through an area of nonmagical darkness filled with lightly obscuring gas?
Why do we read the Megillah by night and by day?
Python Tkinter [Line seperator between buttons]
Calling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Difference between __str__ and __repr__?How to read a file line-by-line into a list?Does Python have a string 'contains' substring method?
so recently i have gotten into Tkinter and been using the docs so far. I ran into this problem where make a visible seperator between my "toolbar buttons", example below:
Home | Insert | PC | Etc..
How could i go about making that seperator, becuase i tried ttk seperator but didnt help me.
Thanks in advance.
python tkinter
add a comment |
so recently i have gotten into Tkinter and been using the docs so far. I ran into this problem where make a visible seperator between my "toolbar buttons", example below:
Home | Insert | PC | Etc..
How could i go about making that seperator, becuase i tried ttk seperator but didnt help me.
Thanks in advance.
python tkinter
1
Please read-up on how to create a Minimal, Complete, and Verifiable example, and post some code to show what you have, so we understand what needs amending.
– kabanus
2 days ago
add a comment |
so recently i have gotten into Tkinter and been using the docs so far. I ran into this problem where make a visible seperator between my "toolbar buttons", example below:
Home | Insert | PC | Etc..
How could i go about making that seperator, becuase i tried ttk seperator but didnt help me.
Thanks in advance.
python tkinter
so recently i have gotten into Tkinter and been using the docs so far. I ran into this problem where make a visible seperator between my "toolbar buttons", example below:
Home | Insert | PC | Etc..
How could i go about making that seperator, becuase i tried ttk seperator but didnt help me.
Thanks in advance.
python tkinter
python tkinter
asked 2 days ago
Johnny NiklassonJohnny Niklasson
161
161
1
Please read-up on how to create a Minimal, Complete, and Verifiable example, and post some code to show what you have, so we understand what needs amending.
– kabanus
2 days ago
add a comment |
1
Please read-up on how to create a Minimal, Complete, and Verifiable example, and post some code to show what you have, so we understand what needs amending.
– kabanus
2 days ago
1
1
Please read-up on how to create a Minimal, Complete, and Verifiable example, and post some code to show what you have, so we understand what needs amending.
– kabanus
2 days ago
Please read-up on how to create a Minimal, Complete, and Verifiable example, and post some code to show what you have, so we understand what needs amending.
– kabanus
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
The ttk library has a Separator
widget which is specifically designed for this. You can also use a frame with a width of 1 or two pixels.
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
toolbar = tk.Frame(root)
toolbar.pack(side="top", fill="x", padx=20, pady=20)
button1 = tk.Button(toolbar, text="Home")
button2 = tk.Button(toolbar, text="Insert")
sep = ttk.Separator(toolbar)
button1.pack(side="left")
sep.pack(side="left", fill="y", padx=4, pady=4)
button2.pack(side="left")
root.mainloop()
Thanks man, this is exactly what i was looking for!
– Johnny Niklasson
yesterday
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55281326%2fpython-tkinter-line-seperator-between-buttons%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The ttk library has a Separator
widget which is specifically designed for this. You can also use a frame with a width of 1 or two pixels.
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
toolbar = tk.Frame(root)
toolbar.pack(side="top", fill="x", padx=20, pady=20)
button1 = tk.Button(toolbar, text="Home")
button2 = tk.Button(toolbar, text="Insert")
sep = ttk.Separator(toolbar)
button1.pack(side="left")
sep.pack(side="left", fill="y", padx=4, pady=4)
button2.pack(side="left")
root.mainloop()
Thanks man, this is exactly what i was looking for!
– Johnny Niklasson
yesterday
add a comment |
The ttk library has a Separator
widget which is specifically designed for this. You can also use a frame with a width of 1 or two pixels.
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
toolbar = tk.Frame(root)
toolbar.pack(side="top", fill="x", padx=20, pady=20)
button1 = tk.Button(toolbar, text="Home")
button2 = tk.Button(toolbar, text="Insert")
sep = ttk.Separator(toolbar)
button1.pack(side="left")
sep.pack(side="left", fill="y", padx=4, pady=4)
button2.pack(side="left")
root.mainloop()
Thanks man, this is exactly what i was looking for!
– Johnny Niklasson
yesterday
add a comment |
The ttk library has a Separator
widget which is specifically designed for this. You can also use a frame with a width of 1 or two pixels.
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
toolbar = tk.Frame(root)
toolbar.pack(side="top", fill="x", padx=20, pady=20)
button1 = tk.Button(toolbar, text="Home")
button2 = tk.Button(toolbar, text="Insert")
sep = ttk.Separator(toolbar)
button1.pack(side="left")
sep.pack(side="left", fill="y", padx=4, pady=4)
button2.pack(side="left")
root.mainloop()
The ttk library has a Separator
widget which is specifically designed for this. You can also use a frame with a width of 1 or two pixels.
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
toolbar = tk.Frame(root)
toolbar.pack(side="top", fill="x", padx=20, pady=20)
button1 = tk.Button(toolbar, text="Home")
button2 = tk.Button(toolbar, text="Insert")
sep = ttk.Separator(toolbar)
button1.pack(side="left")
sep.pack(side="left", fill="y", padx=4, pady=4)
button2.pack(side="left")
root.mainloop()
answered 2 days ago
Bryan OakleyBryan Oakley
221k22274434
221k22274434
Thanks man, this is exactly what i was looking for!
– Johnny Niklasson
yesterday
add a comment |
Thanks man, this is exactly what i was looking for!
– Johnny Niklasson
yesterday
Thanks man, this is exactly what i was looking for!
– Johnny Niklasson
yesterday
Thanks man, this is exactly what i was looking for!
– Johnny Niklasson
yesterday
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55281326%2fpython-tkinter-line-seperator-between-buttons%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Please read-up on how to create a Minimal, Complete, and Verifiable example, and post some code to show what you have, so we understand what needs amending.
– kabanus
2 days ago