Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 27b292f

Browse files
Title bar Update
Update the title bar text witht he file that is opened with File Open menu option.
1 parent 166ed32 commit 27b292f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎Sample GUI Implementation/notepad.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ def open_file() -> str:
224224
with open(file_name, 'r') as f:
225225
WINDOW['-BODY-'].update(value=f.read())
226226
WINDOW['-FILE_INFO-'].update(value=file_name)
227+
228+
WINDOW.set_title(file_name + ' - ' + APP_NAME)
227229
return file_name
228230

229231
def save_file(file_name: str):
@@ -437,11 +439,13 @@ def AboutNotepadPyPlus():
437439
if EVENT in ('Character With Spaces',):
438440
CHARS = character_count()
439441
if CHARS != 0:
440-
ShowMessageBox(title='NotepadPy+ Statistics', message='Characters With Spaces: {:,d}'.format(CHARS))
442+
ShowMessageBox(title='NotepadPy+ Statistics',
443+
message='Characters With Spaces: {:,d}'.format(CHARS))
441444
if EVENT in ('Character Without Spaces',):
442445
CHAR_WITHOUT_SPACES = characters_without_spaces()
443446
if CHAR_WITHOUT_SPACES != 0:
444-
ShowMessageBox(title='NotepadPy+ Statistics', message='Characters Without Spaces: {:,d}'.format(CHAR_WITHOUT_SPACES))
447+
ShowMessageBox(title='NotepadPy+ Statistics',
448+
message='Characters Without Spaces: {:,d}'.format(CHAR_WITHOUT_SPACES))
445449
if EVENT in ('About',):
446450
AboutNotepadPyPlus()
447451

@@ -481,5 +485,5 @@ def AboutNotepadPyPlus():
481485
# file/text is saved.
482486
try:
483487
text_to_save = VALUES['-BODY-']
484-
except:
488+
except:# pylint: disable=bare-except
485489
pass

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /