]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.python/tui-window-factory.py
75932147895ddddb65bc9e15d9c66a17226fb2b4
1 # Copyright (C) 2023-2025 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 def __init__(self
, tui_win
, msg
):
20 self
.tui_win
= tui_win
21 print("Entering TestWindow.__init__: %s" % self
.msg
)
25 self
.tui_win
.write("TestWindow (%s)" % self
.msg
)
28 print("Entering TestWindow.__del__: %s" % self
.msg
)
31 class TestWindowFactory
:
32 def __init__(self
, msg
):
34 print("Entering TestWindowFactory.__init__: %s" % self
.msg
)
36 def __call__(self
, tui_win
):
37 print("Entering TestWindowFactory.__call__: %s" % self
.msg
)
38 return TestWindow(tui_win
, self
.msg
)
41 print("Entering TestWindowFactory.__del__: %s" % self
.msg
)
44 def register_window_factory(msg
):
45 gdb
.register_window_type("test_window", TestWindowFactory(msg
))
48 print("Python script imported")