34 lines
964 B
Python
34 lines
964 B
Python
import gi
|
|
import os
|
|
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_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(main_win_file)
|
|
builder.connect_signals(MainWinHandler())
|
|
|
|
main_win = builder.get_object('main_window')
|
|
main_win.show_all()
|
|
Gtk.main()
|