better code organization, add control bar buttons
This commit is contained in:
parent
83258c5d18
commit
59202e9a7a
30
Window.py
30
Window.py
@ -4,11 +4,13 @@ import gobject
|
|||||||
|
|
||||||
class Window:
|
class Window:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
# Top-level Window creation
|
||||||
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
|
||||||
self.window.set_geometry_hints();
|
self.window.set_geometry_hints();
|
||||||
self.window.connect("delete_event", self.delete_event)
|
self.window.connect("delete_event", self.delete_event)
|
||||||
self.window.connect("destroy", self.destroy_event)
|
self.window.connect("destroy", self.destroy_event)
|
||||||
|
|
||||||
|
# Menu Bar
|
||||||
self.menubar = gtk.MenuBar()
|
self.menubar = gtk.MenuBar()
|
||||||
mi = gtk.MenuItem('_File')
|
mi = gtk.MenuItem('_File')
|
||||||
self.menubar.append(mi)
|
self.menubar.append(mi)
|
||||||
@ -17,7 +19,33 @@ class Window:
|
|||||||
mi = gtk.MenuItem('_Help')
|
mi = gtk.MenuItem('_Help')
|
||||||
self.menubar.append(mi)
|
self.menubar.append(mi)
|
||||||
|
|
||||||
self.window.add(self.menubar)
|
# Projects Table
|
||||||
|
project_table = gtk.Table(rows = 1, columns = 9)
|
||||||
|
|
||||||
|
new_project_combobox = gtk.combo_box_entry_new_text()
|
||||||
|
new_project_combobox.append_text("Project1")
|
||||||
|
new_project_combobox.append_text("Project2")
|
||||||
|
|
||||||
|
project_table.attach(new_project_combobox, 0, 1, 0, 1)
|
||||||
|
|
||||||
|
# Bottom Control Bar
|
||||||
|
self.mark_label = gtk.Label()
|
||||||
|
adjust_button = gtk.Button('Adjust')
|
||||||
|
in_button = gtk.Button('In')
|
||||||
|
out_button = gtk.Button('Out')
|
||||||
|
|
||||||
|
hbox = gtk.HBox()
|
||||||
|
hbox.pack_start(self.mark_label)
|
||||||
|
hbox.pack_start(adjust_button)
|
||||||
|
hbox.pack_start(in_button)
|
||||||
|
hbox.pack_start(out_button)
|
||||||
|
|
||||||
|
vbox = gtk.VBox()
|
||||||
|
vbox.pack_start(self.menubar)
|
||||||
|
vbox.pack_start(project_table)
|
||||||
|
vbox.pack_start(hbox)
|
||||||
|
|
||||||
|
self.window.add(vbox)
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user