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)
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)
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 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)
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)
win.connect("delete-event", Gtk.main_quit) file_chooser_button = Gtk.Button("Выбрать файл") file_chooser_button.connect("clicked", choose_file) # configs = {'100% - 0,1,3': [1, 0.07, 0.47, "0,1,3"], # '94.94% - 0,1,4,5,6':[2, 0.02, 0.35, "0,1,4,5,6"], # '96.50% - 0,1,3,4,5':[2, 0.04, 0.64, "0,1,3,4,5"]} # config_combo = Gtk.ComboBoxText() # config_combo.set_entry_text_column(0) # config_combo.connect("changed", on_config_combo_changed) # for key, value in configs.items(): # config_combo.append_text(str(key)) # config_combo.set_sensitive(False) c_label = Gtk.Label(label="C: ") c_label.set_alignment(0, 0.5) gamma_label = Gtk.Label(label="Gamma: ") gamma_label.set_alignment(0, 0.5) split_label = Gtk.Label(label="Split: ") split_label.set_alignment(0, 0.5) classes_label = Gtk.Label(label="Classes: ") split_label.set_alignment(0, 0.5) c_entry = Gtk.Entry() c_entry.set_placeholder_text("C") gamma_entry = Gtk.Entry() 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")