Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyNutil
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Harry Carey
PyNutil
Commits
bd43b007
Unverified
Commit
bd43b007
authored
7 months ago
by
Sharon Yates
Committed by
GitHub
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add files via upload
parent
f2e80d43
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PyNutilGUI.py
+101
-0
101 additions, 0 deletions
PyNutilGUI.py
with
101 additions
and
0 deletions
PyNutilGUI.py
0 → 100644
+
101
−
0
View file @
bd43b007
import
tkinter
from
tkinter
import
*
from
tkinter
import
ttk
from
tkinter
import
*
from
tkinter
import
ttk
#Basic GUI example
"""
root = Tk()
ttk.Button(root, text=
"
Hello World
"
).grid()
root.mainloop()
"""
root
=
Tk
()
root
.
title
(
"
PyNutil
"
)
#photo = tkinter.PhotoImage(file = 'Logo_PyN.png')
#root.wm_iconphoto(False, photo)
atlas
=
[
"
Reference Atlas
"
,
"
Allen CCFv3
"
,
"
WHS v3
"
,
"
WHS v4
"
]
selected_atlas
=
StringVar
(
value
=
atlas
[
0
])
directory
=
[
"
select
"
,
"
select1
"
,
"
select2
"
]
selected_directory
=
StringVar
(
value
=
atlas
[
0
])
colour
=
[
"
colour
"
,
"
black
"
,
"
red
"
,
"
blue
"
,
"
green
"
]
selected_colour
=
StringVar
(
value
=
colour
[
0
])
def
donothing
():
filewin
=
Toplevel
(
root
)
label
=
Label
(
filewin
,
text
=
"
Do nothing
"
)
label
.
pack
()
def
about_text
():
filewin
=
Toplevel
(
root
)
label
=
Label
(
filewin
,
text
=
"
PyNutil is an application for brain-wide mapping using a reference brain atlas
"
)
label
.
pack
()
#Creating a menu
root
.
option_add
(
'
*tearOff
'
,
FALSE
)
win
=
Toplevel
(
root
)
menubar
=
Menu
(
win
)
#win['menu'] = menubar
root
.
config
(
menu
=
menubar
)
#menubar = Menu(root)
menu_file
=
Menu
(
menubar
)
menu_help
=
Menu
(
menubar
)
menubar
.
add_cascade
(
menu
=
menu_file
,
label
=
'
File
'
)
menubar
.
add_cascade
(
menu
=
menu_help
,
label
=
'
Help
'
)
menu_file
.
add_command
(
label
=
'
New
'
,
command
=
donothing
)
#menu_file.add_command(label='Open...', command=openFile)
menu_file
.
add_command
(
label
=
'
Exit
'
,
command
=
root
.
quit
)
menu_help
.
add_command
(
label
=
'
About PyNutil
'
,
command
=
about_text
)
#Creating a content frame"
mainframe
=
ttk
.
Frame
(
root
,
padding
=
"
12 12 12 12
"
)
# left top right bottom
mainframe
.
grid
(
column
=
0
,
row
=
0
,
sticky
=
(
N
,
W
,
E
,
S
))
root
.
columnconfigure
(
0
,
weight
=
1
)
# column to expand if there is extra space
root
.
rowconfigure
(
0
,
weight
=
1
)
# row to expand if there is extra space
#ttk.Label(mainframe, text="PyNutil settings:").grid(column=0, row=1, sticky=W)
ttk
.
Label
(
mainframe
,
text
=
"
Reference atlas
"
).
grid
(
column
=
1
,
row
=
1
,
sticky
=
W
)
ttk
.
Label
(
mainframe
,
text
=
"
Registration JSON
"
).
grid
(
column
=
1
,
row
=
2
,
sticky
=
W
)
ttk
.
Label
(
mainframe
,
text
=
"
Segmentation folder
"
).
grid
(
column
=
1
,
row
=
3
,
sticky
=
W
)
ttk
.
Label
(
mainframe
,
text
=
"
Object colour
"
).
grid
(
column
=
1
,
row
=
4
,
sticky
=
W
)
ttk
.
Label
(
mainframe
,
text
=
"
Output directory
"
).
grid
(
column
=
1
,
row
=
5
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Help
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
1
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Help
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
2
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Help
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
3
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Help
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
4
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Help
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
2
,
row
=
5
,
sticky
=
W
)
ttk
.
OptionMenu
(
mainframe
,
selected_atlas
,
*
atlas
).
grid
(
column
=
3
,
row
=
1
,
sticky
=
W
)
ttk
.
OptionMenu
(
mainframe
,
selected_directory
,
*
directory
).
grid
(
column
=
3
,
row
=
2
,
sticky
=
W
)
ttk
.
OptionMenu
(
mainframe
,
selected_directory
,
*
directory
).
grid
(
column
=
3
,
row
=
3
,
sticky
=
W
)
ttk
.
OptionMenu
(
mainframe
,
selected_colour
,
*
colour
).
grid
(
column
=
3
,
row
=
4
,
sticky
=
W
)
ttk
.
OptionMenu
(
mainframe
,
selected_directory
,
*
directory
).
grid
(
column
=
3
,
row
=
5
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Browse...
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
4
,
row
=
1
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Browse...
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
4
,
row
=
2
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Browse...
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
4
,
row
=
3
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Select colour
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
4
,
row
=
4
,
sticky
=
W
)
ttk
.
Button
(
mainframe
,
text
=
"
Browse...
"
,
command
=
"
buttonpressed
"
).
grid
(
column
=
4
,
row
=
5
,
sticky
=
W
)
# sunken frame around mainframe
"""
mainframe[
'
borderwidth
'
] = 2
mainframe[
'
relief
'
] =
'
sunken
'
"""
#button.configure()
root
.
mainloop
()
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment