FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PySimpleGUI/DemoPrograms/Demo_Calendar.py at master · PySimpleGUI/PySimpleGUI · GitHub
PySimpleGUI
/
PySimpleGUI
Public
Notifications
You must be signed in to change notification settings
Fork
1.8k
Star
13.8k
Code
Issues
708
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PySimpleGUI
/
DemoPrograms
/
Demo_Calendar.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (22 loc) · 1.61 KB
Breadcrumbs
PySimpleGUI
/
DemoPrograms
/
Demo_Calendar.py
Copy path
File metadata and controls
28 lines (22 loc) · 1.61 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
import
PySimpleGUI
as
sg
"""
Simple test harness to demonstate how to use the CalendarButton and the get date popup
Copyright 2018-2026 PySimpleGUI. All rights reserved.
"""
# sg.theme('Dark Red')
layout
=
[[
sg
.
Text
(
'Date Chooser Test Harness'
,
key
=
'-TXT-'
)],
[
sg
.
Input
(
key
=
'-IN-'
,
size
=
(
20
,
1
)),
sg
.
CalendarButton
(
'Cal US No Buttons Location (0,0)'
,
close_when_date_chosen
=
True
,
target
=
'-IN-'
,
location
=
(
0
,
0
),
no_titlebar
=
False
, )],
[
sg
.
Input
(
key
=
'-IN3-'
,
size
=
(
20
,
1
)),
sg
.
CalendarButton
(
'Cal Monday'
,
title
=
'Pick a date any date'
,
no_titlebar
=
True
,
close_when_date_chosen
=
False
,
target
=
'-IN3-'
,
begin_at_sunday_plus
=
1
,
month_names
=
(
'студзень'
,
'люты'
,
'сакавік'
,
'красавік'
,
'май'
,
'чэрвень'
,
'ліпень'
,
'жнівень'
,
'верасень'
,
'кастрычнік'
,
'лістапад'
,
'снежань'
),
day_abbreviations
=
(
'Дш'
,
'Шш'
,
'Шр'
,
'Бш'
,
'Жм'
,
'Иш'
,
'Жш'
))],
[
sg
.
Input
(
key
=
'-IN2-'
,
size
=
(
20
,
1
)),
sg
.
CalendarButton
(
'Cal German Feb 2020'
,
target
=
'-IN2-'
,
default_date_m_d_y
=
(
2
,
None
,
2020
),
locale
=
'de_DE'
,
begin_at_sunday_plus
=
1
)],
[
sg
.
Input
(
key
=
'-IN4-'
,
size
=
(
20
,
1
)),
sg
.
CalendarButton
(
'Cal Format %m-%d Jan 2020'
,
target
=
'-IN4-'
,
format
=
'%m-%d'
,
default_date_m_d_y
=
(
1
,
None
,
2020
), )],
[
sg
.
Button
(
'Read'
),
sg
.
Button
(
'Date Popup'
),
sg
.
Exit
()]]
window
=
sg
.
Window
(
'window'
,
layout
)
while
True
:
event
,
values
=
window
.
read
()
print
(
event
,
values
)
if
event
in
(
sg
.
WIN_CLOSED
,
'Exit'
):
break
elif
event
==
'Date Popup'
:
sg
.
popup
(
'You chose:'
,
sg
.
popup_get_date
())
window
.
close
()
Back
|
FazBrowse Home
|
New Git URL