def abort_for_escape(window): tray_close() #eject() window.destroy()
def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("destroy", self.destroy) self.window.set_default_size(RESOLUTION[0], RESOLUTION[1]) def disable_cursor(): # Make the cursor invisible # Find the root gdk window and tweak its cursor. gdkwin = self.window.get_root_window() pixmap = gtk.gdk.Pixmap(None, 1, 1, 1) color = gtk.gdk.Color() cursor = gtk.gdk.Cursor(pixmap, pixmap, color, color, 0, 0) gdkwin.set_cursor(cursor) # We run at fullscreen self.window.fullscreen() # disable_cursor() #Show the window self.window.show() tray_close() mainvbox = gtk.VBox(False, 20) self.window.add(mainvbox) mainvbox.show() vscrollbar = gtk.VScrollbar(adjustment=None) #gap fillerhbox = gtk.HBox(True, 0) fillerhbox.set_size_request(-1, 20) fillerhbox.show() mainvbox.pack_start(fillerhbox, False, False) # Title logo = gtk.Image() logo.set_from_file("logo.png") mainlbl = gtk.Label('<span size="37000"><span face="good times"><b>' + 'FREEDOM TOASTER' + '</b></span></span>') mainlbl.set_use_markup(True) mainlbl.show() mainvbox.pack_start(logo, False, False) mainvbox.pack_start(mainlbl, False, False) logo.show() directionsLbl = gtk.Label( '<span size="12000">' + "Choose the distro you want using the navigational keys and press enter" + '</span>') directionsLbl.set_use_markup(True) mainvbox.pack_start(directionsLbl, False, False) directionsLbl.show() # load the list of available software isoList = isolist.populateIsoList() #isonum = isolist.retnumisos() numButtonsAdded = 0 for iso in isoList: # Use this condition if you want two buttons per row: if numButtonsAdded % 3 == 0: # Use this condition if you want one button per row: #if numButtonsAdded % 2 == 0 or numButtonsAdded % 2 == 1: hbox = gtk.HBox(False, 5) mainvbox.pack_start(hbox) hbox.show() # button for this software button = gtk.Button() button.connect("focus-in-event", highlightbutton) button.connect("key-release-event", highlightbutton) button.connect("key-press-event", unhighlightbutton) button.connect("clicked", readyToBurnScreen, iso) hbox.pack_start(button, True, True) button.set_size_request(25, 25) button.show() # This is unfortunately needed because the text in a label will not # wrap to the size of the parent widget so I have to resize the label # manually. # Set the value depending on how many buttons per row you have and # the size of the image. # For a 1024x768 window: # - with one column and 100px buttons: 850 # - with two columns and 100px buttons: 350 buttonTextWidth = 20 populateButton(button, iso, buttonTextWidth) numButtonsAdded += 1 # More stuff button button = gtk.Button() button.connect("clicked", moreStuff) button.connect("focus-in-event", highlightbutton) button.connect("key-release-event", highlightbutton) button.connect("key-press-event", unhighlightbutton) mainvbox.pack_start(button, True, True) button.show() # More stuff button contents label = gtk.Label('<span size="20000"><b>More stuff</b></span>') label.set_use_markup(True) label.show() button.add(label) #get rid of the mouse cursor # XXX: Why multiple times ? <*****@*****.**> # toaster_display = gtk.gdk.display_get_default() # toaster_screen = toaster_display.get_default_screen() # toaster_display.warp_pointer(toaster_screen,-1,-1) #toaster_screen.get_width()+2,toaster_screen.get_height()+2) log.logMessage(MTOASTERSTART, "", "")
def __init__(self): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.connect("destroy", self.destroy) self.window.set_default_size(RESOLUTION[0], RESOLUTION[1]) def disable_cursor(): # Make the cursor invisible # Find the root gdk window and tweak its cursor. gdkwin = self.window.get_root_window() pixmap = gtk.gdk.Pixmap(None, 1, 1, 1) color = gtk.gdk.Color() cursor = gtk.gdk.Cursor(pixmap, pixmap, color, color, 0, 0) gdkwin.set_cursor(cursor) # We run at fullscreen self.window.fullscreen() # disable_cursor() #Show the window self.window.show() tray_close() mainvbox = gtk.VBox(False, 20) self.window.add(mainvbox) mainvbox.show() vscrollbar = gtk.VScrollbar(adjustment=None) #gap fillerhbox = gtk.HBox(True, 0) fillerhbox.set_size_request(-1,20) fillerhbox.show() mainvbox.pack_start(fillerhbox,False,False) # Title logo = gtk.Image() logo.set_from_file("logo.png") mainlbl = gtk.Label('<span size="37000"><span face="good times"><b>' + 'FREEDOM TOASTER' + '</b></span></span>') mainlbl.set_use_markup(True) mainlbl.show() mainvbox.pack_start(logo, False, False) mainvbox.pack_start(mainlbl, False, False) logo.show() directionsLbl = gtk.Label('<span size="12000">' + "Choose the distro you want using the navigational keys and press enter" + '</span>') directionsLbl.set_use_markup(True) mainvbox.pack_start(directionsLbl, False, False) directionsLbl.show() # load the list of available software isoList = isolist.populateIsoList() #isonum = isolist.retnumisos() numButtonsAdded = 0 for iso in isoList: # Use this condition if you want two buttons per row: if numButtonsAdded % 3 == 0: # Use this condition if you want one button per row: #if numButtonsAdded % 2 == 0 or numButtonsAdded % 2 == 1: hbox = gtk.HBox(False, 5) mainvbox.pack_start(hbox) hbox.show() # button for this software button = gtk.Button() button.connect("focus-in-event",highlightbutton) button.connect("key-release-event",highlightbutton) button.connect("key-press-event",unhighlightbutton) button.connect("clicked", readyToBurnScreen, iso) hbox.pack_start(button, True, True) button.set_size_request(25,25) button.show() # This is unfortunately needed because the text in a label will not # wrap to the size of the parent widget so I have to resize the label # manually. # Set the value depending on how many buttons per row you have and # the size of the image. # For a 1024x768 window: # - with one column and 100px buttons: 850 # - with two columns and 100px buttons: 350 buttonTextWidth = 20 populateButton(button, iso, buttonTextWidth) numButtonsAdded += 1 # More stuff button button = gtk.Button() button.connect("clicked", moreStuff) button.connect("focus-in-event",highlightbutton) button.connect("key-release-event",highlightbutton) button.connect("key-press-event",unhighlightbutton) mainvbox.pack_start(button, True, True) button.show() # More stuff button contents label = gtk.Label('<span size="20000"><b>More stuff</b></span>') label.set_use_markup(True) label.show() button.add(label) #get rid of the mouse cursor # XXX: Why multiple times ? <*****@*****.**> # toaster_display = gtk.gdk.display_get_default() # toaster_screen = toaster_display.get_default_screen() # toaster_display.warp_pointer(toaster_screen,-1,-1) #toaster_screen.get_width()+2,toaster_screen.get_height()+2) log.logMessage(MTOASTERSTART, "", "")