Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ps_gui_example
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
python2021
Code
ps_gui_example
Commits
90619c5d
Commit
90619c5d
authored
3 years ago
by
Fedrico Otaran
Browse files
Options
Downloads
Patches
Plain Diff
Agrego nuevo tablero
parent
2d577f97
Loading
Loading
No related merge requests found
Pipeline
#243
failed
3 years ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/component/board.py
+23
-0
23 additions, 0 deletions
src/component/board.py
src/component/menu.py
+13
-4
13 additions, 4 deletions
src/component/menu.py
src/windows/board.py
+17
-0
17 additions, 0 deletions
src/windows/board.py
with
53 additions
and
4 deletions
src/component/board.py
0 → 100644
+
23
−
0
View file @
90619c5d
import
PySimpleGUI
as
sg
from
src.windows
import
board
def
start
():
window
=
loop
()
window
.
close
()
def
loop
():
window
=
board
.
build
(
"
Fede
"
,
"
Milka
"
)
while
True
:
event
,
_values
=
window
.
read
()
if
event
in
(
sg
.
WINDOW_CLOSED
,
"
Exit
"
,
"
-exit-
"
):
break
if
event
.
startswith
(
"
cell
"
):
_prefix
,
x
,
y
=
event
.
split
(
"
-
"
)
print
(
f
"
Celda:
{
x
}
,
{
y
}
"
)
return
window
This diff is collapsed.
Click to expand it.
src/component/menu.py
+
13
−
4
View file @
90619c5d
import
PySimpleGUI
as
sg
from
src.windows
import
menu
from
src.component
import
board
def
start
():
...
...
@@ -17,12 +18,20 @@ def loop():
window
=
menu
.
build
()
while
True
:
event
,
values
=
window
.
read
()
event
,
_
values
=
window
.
read
()
if
event
in
(
sg
.
WINDOW_CLOSED
,
"
Exit
"
)
or
event
==
"
-exit-
"
:
if
event
in
(
sg
.
WINDOW_CLOSED
,
"
Exit
"
,
"
-exit-
"
)
:
break
print
(
event
)
print
(
values
)
if
event
==
"
-play-
"
:
window
.
hide
()
board
.
start
()
window
.
un_hide
()
if
event
==
"
-settings-
"
:
pass
if
event
==
"
-score-
"
:
pass
return
window
This diff is collapsed.
Click to expand it.
src/windows/board.py
0 → 100644
+
17
−
0
View file @
90619c5d
import
PySimpleGUI
as
sg
def
build
(
player1_name
,
player2_name
):
layout
=
[
[
sg
.
Text
(
'
Jugador 1:
'
+
player1_name
,
key
=
'
-P1-
'
,
text_color
=
'
darkblue
'
)],
[
sg
.
Text
(
'
Jugador 2:
'
+
player2_name
,
key
=
'
-P2-
'
,
text_color
=
'
white
'
)],
[
sg
.
Text
(
''
)]
]
for
y
in
range
(
3
):
layout
+=
[
[
sg
.
Button
(
'
'
,
size
=
(
8
,
4
),
key
=
f
"
cell-
{
x
}
-
{
y
}
"
)
for
x
in
range
(
3
)]
]
board
=
sg
.
Window
(
'
Ta Te Ti
'
).
Layout
(
layout
)
return
board
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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