def __init__(self):
        Gtk.Window.__init__(self, title="New Patient Window")
        Gtk.Window.set_default_size(self, window_w,
                                    window_h)  # Set Default Window Size

        patGrid = Gtk.Grid()  # Grid Layout Container
        self.add(patGrid)
        patGrid.props.valign = Gtk.Align.CENTER
        patGrid.props.halign = Gtk.Align.CENTER

        self.firstNameLabel = Gtk.Label("First Name: ")
        self.firstNameEntry = Gtk.Entry()

        patGrid.attach(self.firstNameLabel, 1, 1, 2, 2)
        patGrid.attach_next_to(self.firstNameEntry, self.firstNameLabel, 1, 2,
                               2)  #left=0, r=1, t=2, b=3

        self.lastNameLabel = Gtk.Label("Last Name: ")
        self.lastNameEntry = Gtk.Entry()

        patGrid.attach_next_to(self.lastNameLabel, self.firstNameLabel, 3, 2,
                               2)
        patGrid.attach_next_to(self.lastNameEntry, self.lastNameLabel, 1, 2, 2)

        self.submitButton = Gtk.Button(label="Submit")
        self.submitButton.connect("clicked", self.on_submitButton_clicked)
        patGrid.attach_next_to(self.submitButton, self.lastNameLabel, 3, 4, 2)
Beispiel #2
0
    def homeWindow(self, widget):
        """
        """
        self.homeGrid = Gtk.Grid()  # VBox container for label and for buttons
        self.add(self.homeGrid)

        self.labelGrid = Gtk.Grid()  # Grid for label container
        self.homePageLabel = Gtk.Label("PUSH ASSIST HOME PAGE")

        self.labelGrid.add(self.homePageLabel)
        self.homeGrid.add(self.labelGrid)

        self.labelGrid.props.halign = Gtk.Align.CENTER  # Align center
        self.labelGrid.props.valign = Gtk.Align.END  # Align Center

        homeButtonGrid = Gtk.Grid()  # Grid layout container for buttons
        self.homeGrid.add(homeButtonGrid)  # Add to Vbox container

        homeButtonGrid.props.halign = Gtk.Align.CENTER  # Align center
        homeButtonGrid.props.valign = Gtk.Align.END  # Align botton

        self.openButton = Gtk.Button(
            "Open..."
        )  # Open button... will lead to file selector for past patient files
        self.openButton.connect(
            "clicked", self.on_openButton_clicked)  # Open button action...
        homeButtonGrid.attach(self.openButton, 1, 1, 2,
                              2)  # Open button's layout

        self.newPatButton = Gtk.Button(
            "New Patient"
        )  # New patient button leads to new patient window screen
        self.newPatButton.connect(
            "clicked",
            self.on_newPatButton_clicked)  # New patient button action...
        homeButtonGrid.attach_next_to(self.newPatButton, self.openButton, 1, 2,
                                      2)  #left=0, r=1, t=2, b=3

        self.backButton = Gtk.Button("Back")  # Back button
        self.backButton.connect(
            "clicked", self.on_backButton_clicked)  # Back button action
        homeButtonGrid.attach_next_to(self.backButton, self.newPatButton, 1, 1,
                                      1)  # Back button layout
    def homeWindow(self, widget):
        """
        """
        #self.mainGrid = Gtk.Grid()
        #self.add(self.mainGrid)
        self.mainBox = Gtk.VBox()
        self.add(self.mainBox)

        self.labelGrid = Gtk.Grid()
        self.homePageLabel = Gtk.Label("PUSH ASSIST HOME PAGE")

        self.labelGrid.attach(self.homePageLabel, 1, 1, 2, 2)
        self.mainBox.add(self.labelGrid)

        self.labelGrid.props.valign = Gtk.Align.CENTER
        self.labelGrid.props.halign = Gtk.Align.CENTER

        # ADDING AND REMOVING SUB GRID WORKS:
        #self.mainBox.remove(self.labelGrid)
        #self.mainBox.add(self.labelGrid)

        self.homeButtonGrid = Gtk.Grid()
        self.mainBox.add(self.homeButtonGrid)

        self.homeButtonGrid.props.halign = Gtk.Align.CENTER
        self.homeButtonGrid.props.valign = Gtk.Align.END

        self.openButton = Gtk.Button("Open...")
        self.openButton.connect("clicked", self.on_openButton_clicked)
        self.homeButtonGrid.attach(self.openButton, 1, 1, 2, 2)

        self.newPatButton = Gtk.Button("New Patient")
        self.newPatButton.connect("clicked", self.on_newPatButton_clicked)
        self.homeButtonGrid.attach_next_to(self.newPatButton, self.openButton,
                                           1, 2, 2)  #left=0, r=1, t=2, b=3

        self.backButton = Gtk.Button("Back")
        self.backButton.connect("clicked", self.on_backButton_clicked)
        self.homeButtonGrid.attach_next_to(self.backButton, self.newPatButton,
                                           1, 1, 1)
Beispiel #4
0
    def newPatWin(self, widget):
        """
        """
        self.patGrid = Gtk.Grid()  # Grid Layout Container
        self.homeGrid.add(self.patGrid)
        patGrid.props.valign = Gtk.Align.CENTER
        patGrid.props.halign = Gtk.Align.CENTER

        self.firstNameLabel = Gtk.Label("First Name: ")
        self.firstNameEntry = Gtk.Entry()

        patGrid.attach(self.firstNameLabel, 1, 1, 2, 2)
        patGrid.attach_next_to(self.firstNameEntry, self.firstNameLabel, 1, 2,
                               2)  #left=0, r=1, t=2, b=3
    def __init__(self):
        Gtk.Window.__init__(self, title="InitialWindow")
        Gtk.Window.set_default_size(self, window_w,
                                    window_h)  # Set Default Window Size

        initGrid = Gtk.Grid()
        self.add(initGrid)

        momDisp = Gtk.Box()
        initGrid.add(momDisp)

        self.beginButton = Gtk.Button(label="Begin")
        self.beginButton.connect("clicked", self.on_beginButton_clicked)
        initGrid.add(self.beginButton)

        pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
            "pelvisim.png", 100, 100, True)
        pelvIm = Gtk.Image.new_from_pixbuf(pixbuf)
        initGrid.add(pelvIm)
    def __init__(self):
        Gtk.Window.__init__(self, title="Home Window")
        Gtk.Window.set_default_size(self, window_w,
                                    window_h)  # Set Default Window Size

        #TODO: FIGURE OUT WINDOW STUFF

        self.homeVBox = Gtk.VBox()
        self.add(self.homeVBox)

        self.labelBox = Gtk.Box()
        self.homePageLabel = Gtk.Label("PUSH ASSIST HOME PAGE")

        self.labelBox.add(self.homePageLabel)
        self.homeVBox.add(self.labelBox)

        self.labelBox.props.halign = Gtk.Align.CENTER
        self.labelBox.props.valign = Gtk.Align.END

        homeButtonGrid = Gtk.Grid()  # Grid Layout Container
        self.homeVBox.add(homeButtonGrid)

        homeButtonGrid.props.halign = Gtk.Align.CENTER
        homeButtonGrid.props.valign = Gtk.Align.END
        # self.box.pack_start(menubar, True,True,0)

        self.openButton = Gtk.Button("Open...")
        self.openButton.connect("clicked", self.on_openButton_clicked)
        homeButtonGrid.attach(self.openButton, 1, 1, 2, 2)

        self.newPatButton = Gtk.Button("New Patient")
        self.newPatButton.connect("clicked", self.on_newPatButton_clicked)
        homeButtonGrid.attach_next_to(self.newPatButton, self.openButton, 1, 2,
                                      2)  #left=0, r=1, t=2, b=3

        self.backButton = Gtk.Button("Back")
        self.backButton.connect("clicked", self.on_backButton_clicked)
        homeButtonGrid.attach_next_to(self.backButton, self.newPatButton, 1, 1,
                                      1)
    def __init__(self):
        Gtk.Window.__init__(self, title="New Patient Window")
        Gtk.Window.set_default_size(self, window_w,
                                    window_h)  # Set Default Window Size

        self.grid = Gtk.Grid()  # Grid Layout Container
        self.add(self.grid)

        self.firstNameLabel = Gtk.Label("First Name: ")
        self.firstNameEntry = Gtk.Entry()

        self.grid.add(self.firstNameLabel)
        self.grid.add(self.firstNameEntry)

        self.lastNameLabel = Gtk.Label("Last Name: ")
        self.lastNameEntry = Gtk.Entry()

        self.grid.add(self.lastNameLabel)
        self.grid.add(self.lastNameEntry)

        self.submitButton = Gtk.Button(label="Submit")
        self.submitButton.connect("clicked", self.on_submitButton_clicked)
        self.grid.add(self.submitButton)
Beispiel #8
0
gamma_entry.set_placeholder_text("Gamma")
split_entry = Gtk.Entry()
split_entry.set_placeholder_text("Split")
classes_entry = Gtk.Entry()
classes_entry.set_placeholder_text("Classes")

c_entry.set_width_chars(10)
gamma_entry.set_width_chars(10)
split_entry.set_width_chars(10)
classes_entry.set_width_chars(10)

set_parameters_button = Gtk.Button(label="Установить параметры")
set_parameters_button.connect("clicked", set_parameters)

param_input_grid = Gtk.Grid(column_homogeneous=True,
                            column_spacing=10,
                            row_spacing=5)
param_input_grid.set_sensitive(False)
param_input_grid.attach(c_entry, 0, 0, 1, 1)  #col, row, width, height
param_input_grid.attach(gamma_entry, 1, 0, 1, 1)
param_input_grid.attach(split_entry, 0, 1, 1, 1)
param_input_grid.attach(classes_entry, 1, 1, 1, 1)
param_input_grid.attach(set_parameters_button, 0, 2, 2, 1)

train_button = Gtk.Button.new_with_label("Oбучить классификатор")
train_button.connect("clicked", train)
train_button.set_size_request(150, 75)
train_button.set_sensitive(False)

run_tests_button = Gtk.Button.new_with_label("Тестировать классификатор на\n" +
                                             "испытательном наборе данных")