diff --git a/app.py b/app.py
index 20ae17d..e243f93 100644
--- a/app.py
+++ b/app.py
@@ -4,12 +4,30 @@ gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
resource_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res')
-ui_file = os.path.join(resource_dir, 'ui.glade')
+ui_dir = os.path.join(resource_dir, 'ui')
+main_win_file = os.path.join(ui_dir, 'main_win.glade')
+new_patient_win_file = os.path.join(ui_dir, 'new_patient_win.glade')
+
+def create_new_patient_win():
+ class NewPatienWinHandler:
+ pass
+ b = Gtk.Builder()
+ b.add_from_file(new_patient_win_file)
+ b.connect_signals(NewPatienWinHandler())
+ w = b.get_object('new_patient_window')
+ return w
+
+class MainWinHandler:
+ def main_win_close(self, *args):
+ Gtk.main_quit()
+ def show_new_patient_win(self, button):
+ new_patient_win = create_new_patient_win()
+ new_patient_win.show_all()
builder = Gtk.Builder()
-builder.add_from_file(ui_file)
+builder.add_from_file(main_win_file)
+builder.connect_signals(MainWinHandler())
main_win = builder.get_object('main_window')
-main_win.connect("destroy", Gtk.main_quit)
main_win.show_all()
Gtk.main()
diff --git a/res/ui/main_win.glade b/res/ui/main_win.glade
new file mode 100644
index 0000000..03c0c31
--- /dev/null
+++ b/res/ui/main_win.glade
@@ -0,0 +1,190 @@
+
+
+
+
+
+
diff --git a/res/ui.glade b/res/ui/new_patient_win.glade
similarity index 58%
rename from res/ui.glade
rename to res/ui/new_patient_win.glade
index 0410b64..e7b4d22 100644
--- a/res/ui.glade
+++ b/res/ui/new_patient_win.glade
@@ -2,189 +2,6 @@
-
- False
- ElDoc
- 800
- 500
-
-
-
-
-
- True
- False
-
-
-
- False
- True
- 0
-
-
-
-
- True
- False
-
-
- True
- False
- vertical
-
-
- True
- False
- both
-
-
- True
- False
- Создать
- Создать
- True
- gtk-add
-
-
- False
- True
-
-
-
-
- True
- False
- Изменить
- Изменить
- True
- gtk-edit
-
-
- False
- True
-
-
-
-
- False
- True
- 0
-
-
-
-
- True
- False
-
-
- False
- True
- 2
-
-
-
-
- page1
- Расписание приёмов
-
-
-
-
- True
- False
- vertical
-
-
- True
- False
- icons
-
-
- True
- False
- Добавить
- True
- gtk-add
-
-
- False
- True
-
-
-
-
- True
- False
- Изменить
- True
- gtk-edit
-
-
- False
- True
-
-
-
-
- False
- True
- 0
-
-
-
-
- True
- False
-
-
- False
- True
- 1
-
-
-
-
- True
- False
- True
-
-
- True
- True
- edit-find-symbolic
- False
- False
-
-
-
-
- False
- True
- end
- 2
-
-
-
-
- page0
- Паценты
- 1
-
-
-
-
- True
- True
- 1
-
-
-
-
-
False
True