Exemplo n.º 1
0
 def create_statusbar(self):
     self.statusbar = gtk.Statusbar()
     self.statusbar.set_has_resize_grip(True)
     self.statusbar2 = gtk.Statusbar()
     self.statusbar2.set_has_resize_grip(False)
     self.statusbar.pack_end(self.statusbar2)
     return self.statusbar
    def __init__(self, daddy=None):
        HIGMainWindow.__init__(self)

        self.daddy = daddy

        self.tip_timer = -1
        self.main_accel_group = gtk.AccelGroup()
        self.add_accel_group(self.main_accel_group)

        self.viewernb = HIGNotebook()

        self.invsearch = SearchDB(umitdb)
        self.invdb = ConnectInventoryDB(umitdb)
        self.invtree = InventoryTree(self)
        self.invnb = HIGNotebook()
        self.invnb_close_btn = startup_options()["tabs_close_btn"]
        self.invnbpages_titles = []
        self.invnbpages_objects = []

        # timeline tab
        self.timeline = TLHolder()

        # statusbars
        self.std_statusbar = gtk.Statusbar()
        self.std_sb = self.std_statusbar.get_context_id("stdbar")
        self._write_statusbar("                              ")

        self.tip_statusbar = gtk.Statusbar()
        self.tip_statusbar.set_has_resize_grip(False)
        self.tip_sb = self.tip_statusbar.get_context_id("tipbar")
        self.write_tips = startup_options()["tips"]

        # timer for checking updates
        self.db_stat = os.stat(umitdb).st_mtime
        self.schema_stat = os.stat(Path.sched_schemas).st_mtime
        self.timer_updater = gobject.timeout_add(
            4200,  # nice number
            self.__check_for_updates)

        # gui scheduler controller
        self.schedctrl = SchedControl(self)

        self.inventories = self.invtree.fill_tree()
        self._create_ui_manager()
        self.__set_props()
        self.__do_layout()

        self.connect('inventory-activated', self._inventory_activated)
        self.connect('delete-event', self._exit_ni)
        self.connect('realize', self.on_realize)
Exemplo n.º 3
0
    def __init__(self):
        self.entries = {}

        # Create a new window
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.main_vbox = gtk.VBox()
        self.window.add(self.main_vbox)

        # This is a new call, which just sets the title of our
        # new window to "Hello Buttons!"
        self.window.set_title("WifiTap")
        self.window.set_default_size(640, 480)

        # Here we just set a handler for delete_event that immediately
        # exits GTK.
        self.window.connect("delete_event", self.delete_event)

        # Sets the border width of the window.
        self.window.set_border_width(10)

        # We create a box to pack widgets into.  This is described in detail
        # in the "packing" section. The box is not really visible, it
        # is just used as a tool to arrange widgets.
        self.notebook1 = gtk.Notebook()
        self.tab1 = self.init_config_tab()
        self.notebook1.append_page(self.tab1, gtk.Label("Configuration"))

        self.status_bar = gtk.Statusbar()

        # Put the box into the main window.
        self.main_vbox.add(self.notebook1)
        self.main_vbox.pack_start(self.status_bar, expand=False)

        self.window.show_all()
Exemplo n.º 4
0
    def __init__(self, location, parentw):

        super(Notepad, self).__init__()

        self.location = location
        self.parentw = parentw  # Used to untoggle the open/close list button.

        self.set_title("Blocklist")
        self.set_wmclass("blocklist", "Blockify")
        self.set_default_size(460, 500)
        self.set_position(gtk.WIN_POS_CENTER)

        self.textview = gtk.TextView()
        self.statusbar = gtk.Statusbar()
        self.statusbar.push(0, "Ctrl+S to save, Ctrl+Q/W to close.")

        self.create_keybinds()
        vbox = self.create_layout()

        self.add(vbox)

        self.open_file()
        self.show_all()

        # FIXME: Unholy mess. Why do i have to set value redundantly here?
        swadj = self.sw.get_vadjustment()
        swadj.value = 500
        swadj.set_value(960)

        tvadi = self.textview.get_vadjustment()
        tvadi.value = 500
        tvadi.set_value(960)
Exemplo n.º 5
0
    def __init__(self, interface):
        gtk.Window.__init__(self)
        self.set_title("mogbar3000")

        #Create child widgets
        self.statusbar = gtk.Statusbar()
        self.controls = Controls(interface)
        self.notebook = gtk.Notebook()
        self.notebook.set_scrollable(True)

        #Add children to VBox
        self.box = gtk.VBox()
        self.box.pack_start(self.controls, False, False, 0)
        self.box.pack_start(self.notebook, True, True, 0)
        self.box.pack_start(self.statusbar, False, False, 0)
        self.add(self.box)

        self.connect('delete_event', gtk.main_quit)

        def create_playlist(tracks, name):
            self.notebook.append_page(Playlist(interface), name)

        interface.create_playlist = create_playlist

        def add_tracks(tracks):
            cur = self.notebook.get_current_page()
            if cur == None: return
            cur.store.append()

        #done loading
        self.show_all()
Exemplo n.º 6
0
    def __init__(self):
        gtk.Window.__init__(self)

        self.set_title('Ngine Map Editor')
        self.set_size_request(1024, 600)
        self.set_position(gtk.WIN_POS_CENTER)
        self.connect('delete-event', self.__close)

        # Build the toolbar
        toolbar = gtk.HBox(False)

        # Build the map
        scrolled_map = gtk.ScrolledWindow()
        scrolled_map.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self._map = Map()
        self._map.load('01.map')
        scrolled_map.add_with_viewport(self._map)
        self._map.connect("button-press-event", self.__print)

        # Build the toolbox
        bg_layer = LayerBox('Background')
        bg_layer.toggle.connect('toggled', self.__toggle_layer, 'background')
        dc_layers = LayerBox('Decorations', bg_layer.radio)
        dc_layers.toggle.connect('toggled', self.__toggle_layer, 'decorations')
        uw_layers = LayerBox('Unwalkable', bg_layer.radio)
        uw_layers.toggle.connect('toggled', self.__toggle_layer, 'unwalkable')
        it_layers = LayerBox('Items', bg_layer.radio)
        it_layers.toggle.connect('toggled', self.__toggle_layer, 'items')
        ch_layers = LayerBox('Characters', bg_layer.radio)
        ch_layers.toggle.connect('toggled', self.__toggle_layer, 'characters')

        layers_box = gtk.VBox(False)
        layers_box.pack_start(bg_layer, False, False, 0)
        layers_box.pack_start(dc_layers, False, False, 0)
        layers_box.pack_start(uw_layers, False, False, 0)
        layers_box.pack_start(it_layers, False, False, 0)
        layers_box.pack_start(ch_layers, False, False, 0)
        layers = gtk.Frame('Layers')
        layers.add(layers_box)

        toolbox = gtk.VBox(False)
        toolbox.set_size_request(224, 600)
        toolbox.pack_start(layers, False, False, 0)

        mainbox = gtk.HBox(False)
        mainbox.pack_start(scrolled_map, True, True)
        mainbox.pack_start(toolbox, False, False)

        # Build the statusbar
        self.statusbar = gtk.Statusbar()
        self.statusbar.push(0, 'Welcome...')

        vbox = gtk.VBox(False)
        vbox.pack_start(toolbar, False, False, 0)
        vbox.pack_start(mainbox, True, True, 0)
        vbox.pack_start(self.statusbar, False, False)

        self.add(vbox)

        self.show_all()
Exemplo n.º 7
0
def Main():
    global AppWin, Graph

    AppWin = gtk.Window(gtk.WINDOW_TOPLEVEL)
    AppWin.set_title("Lybniz")
    AppWin.set_default_size(800, 600)
    AppWin.connect("delete-event", QuitDlg)

    AppWin.AccelGroup = gtk.AccelGroup()
    AppWin.add_accel_group(AppWin.AccelGroup)

    AppWin.VBox = gtk.VBox(False, 1)
    AppWin.VBox.set_border_width(1)
    AppWin.add(AppWin.VBox)

    AppWin.StatusBar = gtk.Statusbar()
    AppWin.StatusBar.ContextId = AppWin.StatusBar.get_context_id("Dummy")

    MenuToolbarCreate()
    AppWin.VBox.pack_start(AppWin.MenuMain, False, True, 0)

    HandleBox = gtk.HandleBox()
    HandleBox.add(AppWin.ToolBar)
    AppWin.VBox.pack_start(HandleBox, False, True, 0)

    AppWin.VBox.pack_start(ParameterEntriesCreate(), False, True, 4)

    Graph = GraphClass()
    AppWin.VBox.pack_start(Graph.DrawingArea, True, True, 0)
    AppWin.VBox.pack_start(AppWin.StatusBar, False, True, 0)

    AppWin.show_all()

    gtk.main()
Exemplo n.º 8
0
    def configWindow(self, title, x, y):
        self.set_size_request(x, y)
        self.set_position(gtk.WIN_POS_CENTER)
        self.connect("destroy", self.quit)
        self.set_title(title)

        self.vbox = gtk.VBox(False, 8)

        self.toolbar = gtk.Toolbar()
        self.toolbar.set_style(gtk.TOOLBAR_ICONS)
        self.tbClean = gtk.ToolButton(gtk.STOCK_CLEAR)
        self.tbAutoScroll = gtk.ToggleToolButton(gtk.STOCK_GOTO_BOTTOM)
        self.tbAutoScroll.set_active(self.AScroll)
        self.toolbar.insert(self.tbClean, 0)
        self.toolbar.insert(self.tbAutoScroll, 1)
        self.vbox.pack_start(self.toolbar, False, False, 0)

        self.tbClean.connect("clicked", self.clean)
        self.tbAutoScroll.connect("clicked", self.autoScroll)

        self.area = gtk.DrawingArea()
        self.area.set_size_request(x, 50)
        self.area.connect("expose-event", self.expose)
        self.vbox.pack_start(self.area, False, False, 0)

        self.sw = gtk.ScrolledWindow()
        self.sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        self.sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
        self.vbox.pack_start(self.sw, True, True, 0)

        self.statusbar = gtk.Statusbar()
        self.vbox.pack_start(self.statusbar, False, False, 0)

        self.add(self.vbox)
Exemplo n.º 9
0
    def __init__(self, backend=None):
        """Initializes web UI for carbono"""
        self.backend = backend
        self.window = gtk.Window()
        self.window.set_title(_("Carbono client"))
        self.window.set_default_size(640, 480)
        self.window.connect('destroy', self.quit)

        self.main_vbox = gtk.VBox()
        self.window.add(self.main_vbox)

        # for talking with threads
        self.events = Queue()
        gobject.timeout_add(500, self.check_events)

        self.notebook = gtk.Notebook()
        self.main_vbox.pack_start(self.notebook)

        self.notebook.append_page(self.create_carbono(),
                                  gtk.Label(_("Create an image")))

        self.window.show_all()

        # status bar
        self.statusbar = gtk.Statusbar()
        self.main_vbox.pack_start(self.statusbar, False, False)
        self.messages = []

        self.update(_("Ready for action"))
Exemplo n.º 10
0
    def __init__(self):
        # init ros node
        rospy.init_node('cob_knoeppkes')
        rospy.Subscriber("/emergency_stop_state", EmergencyStopState,
                         self.emcb)

        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.connect("delete_event", self.delete_event)
        self.window.set_title("cob_dashboard")
        self.window.set_size_request(1000, 500)
        vbox = gtk.VBox(False, 1)
        self.hbox = gtk.HBox(True, 10)
        vbox.pack_start(self.hbox, True, True, 0)
        self.gpanel = GtkGeneralPanel()
        self.hbox.pack_start(self.gpanel, True, True, 3)
        b = buttons()
        panels = b.panels
        for pname, actions in panels:
            panel = GtkPanel(self, pname)
            for aname, func, args in actions:
                panel.addButton(text=aname,
                                command=lambda f=func, a=args: start(f, a))
            self.hbox.pack_start(panel, True, True, 3)

        self.status_bar = gtk.Statusbar()
        context_id = self.status_bar.get_context_id("Statusbar")
        string = "Connected to $ROS_MASTER_URI=" + os.environ.get(
            "ROS_MASTER_URI")
        self.status_bar.push(context_id, string)
        vbox.pack_start(self.status_bar, False, False, 0)
        self.window.add(vbox)
        self.window.show_all()
        gtk.gdk.threads_init()
        gtk.main()
Exemplo n.º 11
0
    def __add_controls(self):
        self.set_title("Unused schema entries")
        self.set_default_size(800, 600)

        vbox = gtk.VBox()

        scrolledwindow = gtk.ScrolledWindow()
        scrolledwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

        self.treeview = gtk.TreeView()

        self.treeview.get_selection().set_mode(gtk.SELECTION_SINGLE)

        # Node column
        celltext = gtk.CellRendererText()
        column = gtk.TreeViewColumn("Node", celltext)
        column.set_cell_data_func(celltext, self.set_celltext)

        self.treeview.append_column(column)

        # 0: The node tag
        # 1: Used (0 == Not used, 1 = Child not used, 2 = Used)
        self.treestore = gtk.TreeStore(gobject.TYPE_PYOBJECT,
                                       gobject.TYPE_PYOBJECT)
        self.treeview.set_enable_search(False)

        scrolledwindow.add(self.treeview)
        vbox.pack_start(scrolledwindow)

        self.statusbar = gtk.Statusbar()
        vbox.pack_end(self.statusbar, expand=False)
        self.add(vbox)
Exemplo n.º 12
0
 def __init__(self):
     self.cfg = const.CONFIG
     self.data = data.Storage()
     self.widget_tree = gtk.glade.XML(const.GLADE_PATH, 'frm_main', 'JPA')
     self.widget_tree.signal_autoconnect(self)
     self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
     self.window.connect('delete-event', self.delete_event)
     forms.set_window_icon(self.window)
     self.window.set_border_width(2)
     self.window.set_title('JPA, the Weblog Publishing Assistant')
     self.window.set_size_request(720, 560)
     self.main_box = gtk.VBox()
     uimgr = self._create_ui()
     uimgr.connect('connect-proxy', self._on_uimanager__connect_proxy)
     uimgr.connect('disconnect-proxy', self._on_uimanager__disconnect_proxy)
     menubar = uimgr.get_widget('/Menubar')
     self.main_box.pack_start(menubar, expand=False)
     toolbar = uimgr.get_widget('/Toolbar')
     self.main_box.pack_start(toolbar, expand=False)
     main_widget = self.widget_tree.get_widget('main_box')
     main_widget.unparent()
     self.main_box.pack_start(main_widget)
     self.statusbar = gtk.Statusbar()
     self.main_box.pack_end(self.statusbar, expand=False)
     self.window.add(self.main_box)
     self._menu_cix = -1
     self._set_widget_properties()
     self.queue = Queue.Queue()
Exemplo n.º 13
0
    def insert(self, index=-1, min_width=None, ralign=False):
        """Insert a new statusbar.
        
        Create a new statusbar and insert it at the given index. Index starts
        from '0'. If index is negative the new statusbar is appended.
        The new bar_id is returned.
        
        """
        new_bar = gtk.Statusbar()
        new_bar.show()
        self.pack_start(new_bar, fill=True, expand=True)
        self.reorder_child(new_bar, index)
        self._set_resize_grip()

        if ralign:
            frame = new_bar.get_children()[0]
            obj = frame.get_children()[0]
            # obj was a gtk.Label (GTK 2.16.6),
            # now it is is gtk.HBox (GTK 2.19.1)
            while not isinstance(obj, gtk.Label):
                obj = obj.get_children()[0]
            obj.set_alignment(xalign=1.0, yalign=0.5)

        new_bar_id = self._get_next_id()
        self._bars[new_bar_id] = new_bar

        return new_bar_id
Exemplo n.º 14
0
	def __init__(self):
		gtk.Window.__init__(self)
		self.set_size_request(200,100)
		self.switch = gtk.Button("Start")
		self.switch.connect("clicked", self.switchClicked)

		self.portLabel = gtk.Label("localhost port :")
		self.portEntry = gtk.Entry()
		self.portEntry.set_text("8080")
		self.portEntry.set_width_chars(6)
		self.statbar = gtk.Statusbar()
		self.status_id = self.statbar.get_context_id("main") # for setting status

		box = gtk.HBox()
		box.pack_start(self.portLabel)
		box.pack_start(self.portEntry)

		outmost = gtk.VBox()
		outmost.pack_start(box)
		outmost.pack_start(self.switch)
		outmost.pack_end(self.statbar)

		self.add(outmost)

		self.connect("delete-event", self.quitzies)
		self.service = hidden_service.TorConnection(self)
		self.status("Ready.")
		self.show_all()
Exemplo n.º 15
0
    def __init__(self, title=''):
        gtk.Window.__init__(self)
        self.connect('delete-event', self._on_delete_event)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_size_request(400, 200)
        self.set_title(title)

        main_vbox = gtk.VBox()
        self.add(main_vbox)
        main_vbox.show()

        uimgr = self._create_ui()
        uimgr.connect('connect-proxy',
                      self._on_uimanager__connect_proxy)
        uimgr.connect('disconnect-proxy',
                      self._on_uimanager__disconnect_proxy)

        menubar = uimgr.get_widget('/Menubar')
        main_vbox.pack_start(menubar, expand=False)
        menubar.show()

        toolbar = uimgr.get_widget('/Toolbar')
        main_vbox.pack_start(toolbar, expand=False)
        toolbar.realize()
        toolbar.show()

        status = gtk.Statusbar()
        main_vbox.pack_end(status, expand=False)
        status.show()
        self.statusbar = status

        self._menu_cix = -1
Exemplo n.º 16
0
    def __init__(self):
        self.count = 1
        # create a new window
        window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        window.set_size_request(200, 100)
        window.set_title("PyGTK Statusbar Example")
        window.connect("delete_event", lambda w,e: gtk.main_quit())

        vbox = gtk.VBox(False, 1)
        window.add(vbox)
        vbox.show()

        self.status_bar = gtk.Statusbar()
        vbox.pack_start(self.status_bar, True, True, 0)
        self.status_bar.show()

        context_id = self.status_bar.get_context_id("Statusbar example")

        button = gtk.Button("push item")
        button.connect("clicked", self.push_item, context_id)
        vbox.pack_start(button, True, True, 2)
        button.show()

        button = gtk.Button("pop last item")
        button.connect("clicked", self.pop_item, context_id)
        vbox.pack_start(button, True, True, 2)
        button.show()

        # always display the window as the last step so it all splashes on
        # the screen at once.
        window.show()
Exemplo n.º 17
0
    def __init__(self):
        self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
        self.window.set_title("Statusbar")
        self.window.connect("delete_event", self.delete_event)
        self.window.resize(300, 100)

        vbox = gtk.VBox()
        vbox.set_spacing(6)

        vbox.pack_start(gtk.Label("gtkstatusbar example"), True, True, 0)

        statusbar = gtk.Statusbar()
        store = gtk.ListStore(gobject.TYPE_STRING)
        combo = gtk.ComboBox(store)
        cell = gtk.CellRendererText()
        combo.pack_start(cell, True)
        combo.add_attribute(cell, 'text', 0)
        combo.insert_text(0, "Apple")
        combo.insert_text(1, "Banana")
        combo.insert_text(2, "Cherry")
        statusbar.add(combo)
        statusbar.push(0, "This is some text in the statusbar")
        statusbar.add(gtk.ToolButton(gtk.STOCK_ABOUT))
        statusbar.add(gtk.ToolButton(gtk.STOCK_OPEN))
        vbox.pack_start(statusbar, False, False, 0)

        self.window.add(vbox)

        vbox.show_all()
        self.window.show()
Exemplo n.º 18
0
    def __init__(self, window, file_handler):
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)

        self._window = window

        self.resize(prefs['lib window width'], prefs['lib window height'])
        self.set_title(_('Library'))
        self.connect('delete_event', self.close)
        self.connect('key-press-event', self._key_press_event)

        self.filter_string = None
        self._file_handler = file_handler
        self._statusbar = gtk.Statusbar()
        self._statusbar.set_has_resize_grip(True)
        self.backend = library_backend.LibraryBackend()
        self.book_area = library_book_area._BookArea(self)
        self.control_area = library_control_area._ControlArea(self)
        self.collection_area = library_collection_area._CollectionArea(self)

        self.backend.watchlist.new_files_found += self._new_files_found

        table = gtk.Table(2, 2, False)
        table.attach(self.collection_area, 0, 1, 0, 1, gtk.FILL,
                     gtk.EXPAND | gtk.FILL)
        table.attach(self.book_area, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL,
                     gtk.EXPAND | gtk.FILL)
        table.attach(self.control_area, 0, 2, 1, 2, gtk.EXPAND | gtk.FILL,
                     gtk.FILL)

        if prefs['show statusbar']:
            table.attach(self._statusbar, 0, 2, 2, 3, gtk.FILL, gtk.FILL)

        self.add(table)
        self.show_all()
        self.present()
Exemplo n.º 19
0
    def __init__(self, crawler):
        """Initializes web UI for bugzilla"""
        self.crawler = crawler
        self.window = gtk.Window()
        self.window.set_title(_("Support client"))
        self.window.set_default_size(640, 480)
        self.window.connect('destroy', self.quit)

        self.main_vbox = gtk.VBox()
        self.window.add(self.main_vbox)

        self.notebook = gtk.Notebook()
        self.main_vbox.pack_start(self.notebook)

        # search timeout/interval
        self.modification_ts = time.time()
        self.last_search = self.modification_ts
        self.search_timeout = 1
        gobject.timeout_add(1000, self.do_search)

        # status bar
        self.statusbar = gtk.Statusbar()
        self.main_vbox.pack_start(self.statusbar, False, False)
        self.messages = []

        self.events = Queue()
        gobject.timeout_add(500, self.check_events)

        self.notebook.append_page(self.create_report_window(),
                                  gtk.Label(_("Report a problem")))
        #        self.notebook.append_page(self.create_my_reports(), gtk.Label(_("My reported issues")))

        self.window.show_all()

        self.update(_("Ready for search"))
Exemplo n.º 20
0
    def __init__(self, size=(300, 300), name="Piddle-GTK2", infoline=1):
        """Initialize the canvas and minimal supporting widgets.

        If |infoline| is true (the default), a status bar will be
        included at the bottom of the window to support the
        ,setInfoLine() method.  If false, no statusbar will be used.

        """
        width, height = (int(round(size[0])), int(round(size[1])))
        #
        top = self.__top = gtk.Window()
        vbox = self.__vbox = gtk.VBox()
        da = gtk.DrawingArea()
        #
        top.add(vbox)
        vbox.pack_start(da)
        if infoline:
            sbar = self.__sbar = gtk.Statusbar()
            vbox.pack_end(sbar, expand=0)
            sbar.set_border_width(2)
        else:
            self.__sbar = None
        InteractiveCanvas.__init__(self, da, top)
        top.set_wmclass("canvas", "Canvas")
        da.realize()
        da.set_usize(width, height)
        top.show_all()
        top.set_icon_name(name)
        top.set_title(name)
        self.ensure_size(width, height)
        self.__status = None
Exemplo n.º 21
0
def test():
    '''test the implementation'''
    import dialog
    import abstract.MainMenu as MainMenu

    def quit_cb(item):
        '''method called when the quit item is selected'''
        gtk.main_quit()

    def status_cb(item, stat):
        '''method called when a status is selected'''
        print 'status', status.STATUS[stat], 'selected'

    window = gtk.Window()
    window.set_default_size(200, 200)
    window.connect('delete-event', gtk.main_quit)
    vbox = gtk.VBox()

    logged_in = True

    menu = MainMenu.MainMenu(dialog, None, None, None)
    vbox.pack_start(build_menu_bar(menu), False)
    vbox.pack_start(gtk.Label('test'), True, True)
    vbox.pack_start(gtk.Statusbar(), False)
    window.add(vbox)
    window.show_all()
    menu.status_item.enabled = False
    menu.order_option.enabled = False
    menu.quit_item.enabled = False
    menu.help_menu.enabled = False
    menu.show_by_nick_option.enabled = False
    gtk.main()
Exemplo n.º 22
0
 def __init__(self):
     self.FILENAME = os.path.join(get_wdir(), "tags.txt")
     self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
     self.window.connect("delete_event", self.delete_event)
     self.window.connect("destroy", self.destroy)
     self.window.set_title(_("XPN TagLines Manager"))
     self.window.set_position(gtk.WIN_POS_CENTER)
     vbox = gtk.VBox(False, 0)
     vbox.set_border_width(2)
     label = gtk.Label(_("\n<b>Insert here a tagline</b>\n"))
     label.set_use_markup(True)
     vbox.pack_start(label, True, True, 0)
     self.entry = gtk.Entry()
     self.entry.connect("changed", self.show_length)
     vbox.pack_start(self.entry, False, True, 0)
     hbox_buttons = gtk.HBox()
     hbox_buttons.set_border_width(4)
     self.button_ok = gtk.Button(None, gtk.STOCK_ADD)
     self.button_ok.connect("clicked", self.append_tag)
     self.button_close = gtk.Button(None, gtk.STOCK_CLOSE)
     self.button_close.connect("clicked", self.destroy)
     hbox_buttons.pack_start(self.button_close, True, True, 2)
     hbox_buttons.pack_start(self.button_ok, True, True, 2)
     vbox.pack_start(hbox_buttons, True, True, 0)
     self.statusbar = gtk.Statusbar()
     vbox.pack_start(self.statusbar, False, True, 0)
     self.window.add(vbox)
     self.window.set_default_size(550, 60)
     self.window.show_all()
     self.load_state()
Exemplo n.º 23
0
 def __init__(self, **kw):
     if not hasattr(self, '_obj'):
         obj = gtk.Window()
         vbox = gtk.VBox()
         hbox = gtk.HBox()
         prog = gtk.ProgressBar()
         prog.set_sensitive(False)
         prog.set_size_request(75, -1)
         prog.set_fraction(0)
         status = gtk.Statusbar()
         status.set_has_resize_grip(False)
         status.set_size_request(200, -1)
         image = gtk.Image()
         self._obj = obj
         self._vbox = vbox
         self._hbox = hbox
         self._status = status
         self._prog = prog
         self._img = image
         self._img_stack = [gtk.STOCK_YES]
         self._img_dict = {}
         image.set_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_MENU)
         obj.add(vbox)
         obj.connect('delete_event', self.__delete)
         vbox.pack_end(hbox, False, False)
         hbox.pack_start(image, False, False)
         hbox.pack_start(status, True, True)
         hbox.pack_start(prog, False, False)
     super(Gtk2Window, self).__init__(**kw)
Exemplo n.º 24
0
    def __init__(self, codec):
        gtk.Window.__init__(self)
        self.codec = codec
        self.connect('destroy', self.__destroy)
        self.set_default_size(800, 600)
        self.set_title(self.__class__.__name__ + ' ' + self.codec.name)
        self.set_border_width(0)

        table = gtk.Table(2, 3, False)
        self.add(table)

        statusbar = gtk.Statusbar()
        self.layout = CodecGraphLayout(None, None, codec, self.get_title(),
                                       statusbar)
        table.attach(self.layout, 0, 1, 0, 1, gtk.FILL | gtk.EXPAND,
                     gtk.FILL | gtk.EXPAND, 0, 0)
        vScrollbar = gtk.VScrollbar(None)
        table.attach(vScrollbar, 1, 2, 0, 1, gtk.FILL | gtk.SHRINK,
                     gtk.FILL | gtk.SHRINK, 0, 0)
        hScrollbar = gtk.HScrollbar(None)
        table.attach(hScrollbar, 0, 1, 1, 2, gtk.FILL | gtk.SHRINK,
                     gtk.FILL | gtk.SHRINK, 0, 0)
        vAdjust = self.layout.get_vadjustment()
        vScrollbar.set_adjustment(vAdjust)
        hAdjust = self.layout.get_hadjustment()
        hScrollbar.set_adjustment(hAdjust)
        table.attach(statusbar, 0, 2, 2, 3, gtk.FILL | gtk.SHRINK,
                     gtk.FILL | gtk.SHRINK, 0, 0)
        self.show_all()
        GRAPH_WINDOWS[codec] = self
        TRACKER.add(self)
Exemplo n.º 25
0
    def __init__(self, parent):
        gtk.Window.__init__(self)

        self.set_default_size(800, 600)
        self.set_title("Slice View")
        self.set_modal(True)
        self.set_transient_for(parent)

        mainvbox = gtk.VBox()
        self.vbox = gtk.VBox()

        scrolledWindow = gtk.ScrolledWindow()
        scrolledWindow.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        scrolledWindow.add_with_viewport(self.vbox)

        self.databuttons = databuttonswidget.DataButtonsWidget()

        self.statusbar = gtk.Statusbar()

        mainvbox.pack_start(scrolledWindow, True)
        mainvbox.pack_start(self.databuttons, False)
        mainvbox.pack_start(self.statusbar, False)

        self.add(mainvbox)
        self.show_all()
Exemplo n.º 26
0
    def __init__(self):
        super(PyApp, self).__init__()

        self.set_size_request(350, 250)
        self.set_position(gtk.WIN_POS_CENTER)

        self.connect("destroy", gtk.main_quit)
        self.set_title("ListView")

        vbox = gtk.VBox(False, 8)

        sw = gtk.ScrolledWindow()
        sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
        sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)

        vbox.pack_start(sw, True, True, 0)

        store = self.create_model()

        treeView = gtk.TreeView(store)
        treeView.connect("row-activated", self.on_activated)
        treeView.set_rules_hint(True)
        sw.add(treeView)

        self.create_columns(treeView)
        self.statusbar = gtk.Statusbar()

        vbox.pack_start(self.statusbar, False, False, 0)

        self.add(vbox)
        self.show_all()
Exemplo n.º 27
0
 def _create_statusbar(self):
     self._statusbar = gtk.HBox()
     self._status_holder = gtk.Statusbar()
     # OMG
     frame = self._status_holder.get_children()[0]
     frame.remove(frame.get_children()[0])
     frame.add(self._statusbar)
Exemplo n.º 28
0
    def __init__(self, file_handler):
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
        self.resize(prefs['lib window width'], prefs['lib window height'])
        self.set_title(_('Library'))
        self.connect('delete_event', self.close)

        self.filter_string = None
        self._file_handler = file_handler
        self._statusbar = gtk.Statusbar()
        self._statusbar.set_has_resize_grip(True)
        self.backend = librarybackend.LibraryBackend()
        self.book_area = _BookArea(self)
        self.control_area = _ControlArea(self)
        self.collection_area = _CollectionArea(self)

        table = gtk.Table(2, 2, False)
        table.attach(self.collection_area, 0, 1, 0, 1, gtk.FILL,
                     gtk.EXPAND | gtk.FILL)
        table.attach(self.book_area, 1, 2, 0, 1, gtk.EXPAND | gtk.FILL,
                     gtk.EXPAND | gtk.FILL)
        table.attach(self.control_area, 0, 2, 1, 2, gtk.EXPAND | gtk.FILL,
                     gtk.FILL)
        table.attach(self._statusbar, 0, 2, 2, 3, gtk.FILL, gtk.FILL)
        self.add(table)
        self.show_all()
Exemplo n.º 29
0
    def _create_widgets(self):
        self.service_table.set_border_width(5)
        self.status_bar = gtk.Statusbar()
        self.hbox = gtk.HBox()
        self.hbox.set_border_width(5)
        self.service_icon = gtk.Image()
        self.service_icon.set_from_file(join(Path.icons_dir, "umit_128.ico"))

        self.serviceinfo_vbox = gtk.VBox()
        self.main_label = gtk.Label()
        self.main_label.set_use_markup(True)
        self.main_label.set_markup("<b>UMIT Service Info</b>")

        self.status_label = gtk.Label()
        self.status_label.set_use_markup(True)

        self.status_table = gtk.Table(2, 3)

        self.start_button = gtk.Button()
        self.stop_button = gtk.Button()
        self.restart_button = gtk.Button()

        img_start = gtk.Image()
        img_start.set_from_stock(gtk.STOCK_MEDIA_PLAY, gtk.ICON_SIZE_BUTTON)
        self.start_button.set_image(img_start)

        img_stop = gtk.Image()
        img_stop.set_from_stock(gtk.STOCK_MEDIA_STOP, gtk.ICON_SIZE_BUTTON)
        self.stop_button.set_image(img_stop)

        img_restart = gtk.Image()
        img_restart.set_from_stock(gtk.STOCK_REFRESH, gtk.ICON_SIZE_BUTTON)
        self.restart_button.set_image(img_restart)

        self.status_label = gtk.Label()

        self.status_icon = gtk.StatusIcon()
        self.status_icon.set_from_file(join(Path.icons_dir, "umit_16.ico"))

        self.popup_menu = gtk.Menu()
        self.menuitem_open = gtk.MenuItem("Open UmitWeb")
        self.menuitem_show = gtk.MenuItem("Show management console")
        self.menuitem_start = gtk.MenuItem("Start service")
        self.menuitem_stop = gtk.MenuItem("Stop service")
        self.menuitem_restart = gtk.MenuItem("Restart service")
        self.menuitem_exit = gtk.MenuItem("Exit")

        self.port_entry = gtk.SpinButton(climb_rate=1, digits=0)
        self.port_entry.set_range(1, 65535)

        self.address_entry = gtk.Entry()

        self.service_status_checkbutton = gtk.CheckButton(
            "Start UmitWeb Service at Startup")
        self.console_checkbutton = gtk.CheckButton(
            "Start Management Console at Startup")
        self.apply_button = gtk.Button("Apply Changes")

        self._sbar_ctx = self.status_bar.get_context_id("Umit Status")
Exemplo n.º 30
0
    def __init__(self):
        super(Statusbar, self).__init__()

        self._loading = True

        # Status text, page number, file number, resolution, path, filename, filesize
        self.status = gtk.Statusbar()
        self.add(self.status)

        # Create popup menu for enabling/disabling status boxes.
        self.ui_manager = gtk.UIManager()
        self.tooltipstatus = TooltipStatusHelper(self.ui_manager, self.status)
        ui_description = """
        <ui>
            <popup name="Statusbar">
                <menuitem action="pagenumber" />
                <menuitem action="filenumber" />
                <menuitem action="resolution" />
                <menuitem action="rootpath" />
                <menuitem action="filename" />
                <menuitem action="filesize" />
            </popup>
        </ui>
        """
        self.ui_manager.add_ui_from_string(ui_description)

        actiongroup = gtk.ActionGroup('mcomix-statusbar')
        actiongroup.add_toggle_actions([
            ('pagenumber', None, _('Show page numbers'), None, None,
             self.toggle_status_visibility),
            ('filenumber', None, _('Show file numbers'), None, None,
             self.toggle_status_visibility),
            ('resolution', None, _('Show resolution'), None, None,
             self.toggle_status_visibility),
            ('rootpath', None, _('Show path'), None, None,
             self.toggle_status_visibility),
            ('filename', None, _('Show filename'), None, None,
             self.toggle_status_visibility),
            ('filesize', None, _('Show filesize'), None, None,
             self.toggle_status_visibility)
        ])
        self.ui_manager.insert_action_group(actiongroup, 0)

        # Hook mouse release event
        self.connect('button-release-event', self._button_released)
        self.set_events(gtk.gdk.BUTTON_PRESS_MASK
                        | gtk.gdk.BUTTON_RELEASE_MASK)

        # Default status information
        self._page_info = ''
        self._file_info = ''
        self._resolution = ''
        self._root = ''
        self._filename = ''
        self._filesize = ''
        self._update_sensitivity()
        self.show_all()

        self._loading = False