def __init__(self, ): self.radky = 3 self.setup = mysetup.setup() self.hBox = gtk.HBox() self.Z_listStore = gtk.ListStore (str, int) #UPDATE ON COLUMN CHANGE self.Z_treeView = gtk.TreeView (self.Z_listStore) self.Z_nazevCell = gtk.CellRendererText () self.Z_nazevColumn = gtk.TreeViewColumn ('Nazev', self.Z_nazevCell, text=Z_COLUMN_NAZEV) self.Z_cenaCell = gtk.CellRendererText () self.Z_cenaColumn = gtk.TreeViewColumn ('Cena', self.Z_cenaCell, text=Z_COLUMN_CENA) self.Z_treeView.append_column (self.Z_nazevColumn) self.Z_treeView.append_column (self.Z_cenaColumn) self.Z_treeScroll = gtk.ScrolledWindow() self.Z_treeScroll.add (self.Z_treeView) self.Z_treeScroll.set_policy (gtk.POLICY_NEVER, gtk.POLICY_NEVER) self.Z_treeScroll.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) self.Z_treeView.connect ("cursor-changed", self.ZChanged) self.hBox.pack_start (self.Z_treeScroll) self.T_listStore = gtk.ListStore (str, 'gboolean') #UPDATE ON COLUMN CHANGE self.T_treeView = gtk.TreeView (self.T_listStore) self.T_nazevCell = gtk.CellRendererText () self.T_nazevColumn = gtk.TreeViewColumn ('Nazev', self.T_nazevCell, text=T_COLUMN_NAZEV) self.T_cenaCell = gtk.CellRendererToggle () self.T_cenaColumn = gtk.TreeViewColumn ('Je', self.T_cenaCell, active=T_COLUMN_JE) self.T_treeView.append_column (self.T_nazevColumn) self.T_treeView.append_column (self.T_cenaColumn) self.T_treeScroll = gtk.ScrolledWindow() self.T_treeScroll.add (self.T_treeView) self.T_treeScroll.set_policy (gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC) self.T_treeView.connect ("row-activated", self.TActivated) self.hBox.pack_start (self.T_treeScroll) self.hBoxBut = gtk.HBox () self.BAdd = gtk.Button ('_Přidat tabák') self.BAdd.connect ('clicked', self.onAdd) self.hBoxBut.add (self.BAdd) self.BPreviewX = gtk.Button (u'Náhled Tabulky') self.BPreviewX.connect ('clicked', self.onPreviewX) self.hBoxBut.add (self.BPreviewX) self.BPrintX = gtk.Button (u'Tisk Tabulky') self.BPrintX.connect ('clicked', self.onPrintX) self.hBoxBut.add (self.BPrintX) self.BPreview = gtk.Button ('_Náhled') self.BPreview.connect ('clicked', self.onPreview) self.hBoxBut.add (self.BPreview) self.BPrint = gtk.Button ('_Tisk') self.BPrint.connect ('clicked', self.onPrint) self.hBoxBut.add (self.BPrint) self.vBox = gtk.VBox () self.vBox.add (self.hBox) self.vBox.pack_start(self.hBoxBut, False, False, 2) self.widget = gtk.Frame() self.widget.add (self.vBox) self.RepopulateZ ()
def __init__(self): self.radku = 3 self.setup = mysetup.setup() self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_title('Tabakovnik') self.window.connect("destroy", self.destroy) self.VBox = gtk.VBox() self.window.add (self.VBox) menu_bar = gtk.MenuBar() self.VBox.pack_start(menu_bar, False, False, 2) file_menu_i = gtk.MenuItem("_File") menu_bar.append (file_menu_i) file_menu = gtk.Menu() it = gtk.MenuItem('S_ave') file_menu.append (it) it.connect("activate", self.onSave) it = gtk.MenuItem('E_xit') file_menu.append (it) it.connect("activate", self.destroy) file_menu_i.set_submenu (file_menu) self.znackovnik = Znackovnik () self.RHBox = gtk.HBox () RadioRIII = gtk.RadioButton (None, "3 radky") RadioRIII.connect("clicked", self.OnRadkyIII) self.RHBox.add (RadioRIII) RadioRII = gtk.RadioButton (RadioRIII, "2 radky") RadioRII.connect("clicked", self.OnRadkyII) self.RHBox.add (RadioRII) RadioRI = gtk.RadioButton (RadioRIII, "1 radky") RadioRI.connect("clicked", self.OnRadkyI) self.RHBox.add (RadioRI) self.VBox.pack_start (self.RHBox, False, False) self.VBox.add (self.znackovnik.widget) self.window.show_all()
import mysetup import znacky m = mysetup.setup() m.save() # print znacky.znackyToTeX (m.znacky) print(znacky.znackyToTB(m.znacky).obdelnik) znacky.znackyToTB(m.znacky).GV()