当前位置: 首页>>代码示例>>Python>>正文


Python signal.FControl类代码示例

本文整理汇总了Python中foobnix.gui.model.signal.FControl的典型用法代码示例。如果您正苦于以下问题:Python FControl类的具体用法?Python FControl怎么用?Python FControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了FControl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)
        Gtk.Window.__init__(self, Gtk.WindowType.POPUP)

        self.set_position(Gtk.WindowPosition.MOUSE)
        self.connect("leave-notify-event", self.on_leave_window)
        Notify.init('Foobnix')
开发者ID:kagel,项目名称:foobnix,代码行数:7,代码来源:tray_icon.py

示例2: __init__

 def __init__(self, controls):
     FControl.__init__(self, controls)
     Gtk.HBox.__init__(self, False, 0)
     
     self.old_menu = MenuBarWidget(controls)
     
     
     self.pack_start(self.old_menu.widget, False, False, 0)
     
     self.new_menu_button = ImageButton(Gtk.STOCK_PREFERENCES)
     self.new_menu_button.connect("button-press-event", self.on_button_press)
     
     self.pack_start(self.new_menu_button, False, False, 0)
     self.pack_start(controls.playback, False, False, 0)
     self.pack_start(controls.os, False, False, 0)
     self.pack_start(controls.volume, False, False, 0)
     self.pack_start(Gtk.SeparatorToolItem(), False, False, 0)
     self.pack_start(controls.record, False, False, 0)
     self.pack_start(controls.seek_bar, True, True, 0)
     
     """menu init"""
     menu = Popup()
     decorator = MenuStyleDecorator()
     MenuBarWidget(self.controls, menu)
     menu.add_separator()        
     menu.add_item(_("Preferences"), Gtk.STOCK_PREFERENCES, self.controls.show_preferences)
     menu.add_separator()
     menu.add_item(_("Quit"), Gtk.STOCK_QUIT, self.controls.quit)
     
     decorator.apply(menu)
     self.menu = menu
开发者ID:kaesve,项目名称:foobnix,代码行数:31,代码来源:top.py

示例3: __init__

    def __init__(self, controls, seek_bar_movie=None):
        FControl.__init__(self, controls)
        self.seek_bar_movie = seek_bar_movie
        Gtk.Alignment.__init__(self, xalign=0.5, yalign=0.5, xscale=1.0, yscale=1.0)

        self.set_padding(padding_top=7, padding_bottom=7, padding_left=0, padding_right=7)

        self.tooltip = Gtk.Window(Gtk.WindowType.POPUP)
        self.tooltip.set_position(Gtk.WindowPosition.CENTER)
        self.tooltip_label = Gtk.Label.new(None)
        self.tooltip.add(self.tooltip_label)

        self.progressbar = Gtk.ProgressBar()
        self.progressbar.set_ellipsize(Pango.EllipsizeMode.END)
        self.progressbar.set_property("show-text", True)
        self.progressbar.set_text("00:00 / 00:00")
        try:
            self.progressbar.set_has_tooltip(True)
        except:
            #fix debian compability
            pass

        event = Gtk.EventBox()
        event.add(self.progressbar)
        event.connect("button-press-event", self.on_seek)
        event.connect("leave-notify-event", lambda *a: self.safe_hide_tooltip())
        event.connect("motion-notify-event", self.on_pointer_motion)
        self.add(event)
        self.show_all()
        self.tooltip.hide()
开发者ID:foobnix,项目名称:foobnix,代码行数:30,代码来源:seekbar.py

示例4: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)
        Gtk.HBox.__init__(self, False, 0)

        self.old_menu = MenuBarWidget(controls)


        self.pack_start(self.old_menu.widget, False, False, 0)

        self.new_menu_button = ImageButton("preferences-system", tooltip_text=_("Settings"))
        self.new_menu_button.connect("button-press-event", self.on_button_press)

        self.pack_start(self.new_menu_button, False, False, 0)
        self.pack_start(controls.playback, False, False, 0)
        self.pack_start(controls.os, False, False, 0)
        self.pack_start(controls.volume, False, False, 0)
        self.pack_start(Gtk.SeparatorToolItem.new(), False, False, 0)
        self.pack_start(controls.record, False, False, 0)
        self.pack_start(controls.seek_bar, True, True, 0)

        """menu init"""
        menu = Popup()
        decorator = MenuStyleDecorator()
        MenuBarWidget(self.controls, menu)
        menu.add_separator()
        menu.add_item(_("Preferences"), "preferences-system", self.controls.show_preferences)
        menu.add_separator()
        menu.add_item(_("Quit"), "application-exit", self.controls.quit)

        decorator.apply(menu)
        self.menu = menu
开发者ID:kagel,项目名称:foobnix,代码行数:31,代码来源:top.py

示例5: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)

        """ set application stylesheet"""
        self.style_provider = Gtk.CssProvider()
        ## TODO: after moving style to resource - replace to load_from_file
        self.style_provider.load_from_data(foobnix_style)
        Gtk.StyleContext.add_provider_for_screen(
            Gdk.Screen.get_default(),
            self.style_provider,
            Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
        )

        self.controls = controls
        bbox = Gtk.VBox(False, 0)
        notebox = Gtk.Overlay.new()
        notebox.add(controls.notetabs)
        notebox.add_overlay(controls.search_progress)

        bbox.pack_start(notebox, True, True, 0)
        #bbox.pack_start(controls.movie_window, False, False, 0)

        center_box = Gtk.VBox(False, 0)
        center_box.pack_start(controls.searchPanel, False, False, 0)
        center_box.pack_start(bbox, True, True, 0)

        self.hpaned_left = Gtk.HPaned()
        self.hpaned_left.connect("motion-notify-event", self.on_motion)

        self.hpaned_left.pack1(child=controls.perspectives, resize=True, shrink=True)
        self.hpaned_left.pack2(child=center_box, resize=True, shrink=True)

        self.hpaned_right = Gtk.HPaned()
        self.hpaned_right.connect("motion-notify-event", self.on_motion)
        self.hpaned_right.pack1(child=self.hpaned_left, resize=True, shrink=True)
        self.hpaned_right.pack2(child=controls.coverlyrics, resize=True, shrink=False)

        vbox = Gtk.VBox(False, 0)
        vbox.pack_start(controls.top_panel, False, False, 0)
        vbox.pack_start(self.hpaned_right, True, True, 0)
        vbox.pack_start(controls.statusbar, False, True, 0)
        vbox.show_all()

        self.hpaned_left.connect("button-press-event", self.on_border_press)
        self.hpaned_right.connect("button-press-event", self.on_border_press)
        self.hpaned_left.connect("button-release-event", self.on_border_release)
        self.hpaned_right.connect("button-release-event", self.on_border_release)
        self.id_handler_left = self.hpaned_left.connect("size-allocate", self.on_configure_hl_event)
        self.id_handler_right = self.hpaned_right.connect("size-allocate", self.on_configure_hr_event)

        self.hpaned_press_release_handler_blocked = False

        controls.main_window.connect("configure-event", self.on_configure_event)
        controls.main_window.add(vbox)
开发者ID:Andresteve07,项目名称:foobnix,代码行数:54,代码来源:base_layout.py

示例6: __init__

 def __init__(self, controls):
     Gtk.Notebook.__init__(self)
     FControl.__init__(self, controls)
     self.controls = controls
     self.set_properties("tab-expand", True)
     self.set_scrollable(True)
     self.save_lock = threading.Lock()
     self.connect("page-reordered", self.reorder_callback)
     add_button = ImageButton(Gtk.STOCK_ADD, func=self.on_add_button_click, size=Gtk.IconSize.BUTTON)
     add_button.show()
     add_button.get_image().set_size_request(24, 22)
     self.set_action_widget(add_button, Gtk.PackType.START)
     self.default_angle = 0
     self.navig = False if isinstance(self, NoteTabControl) else True
开发者ID:strogo,项目名称:foobnix,代码行数:14,代码来源:__init__.py

示例7: __init__

    def __init__(self, controls):
        Gtk.HBox.__init__(self, False, 0)
        FControl.__init__(self, controls)

        adjustment = Gtk.Adjustment(value=1, lower=0, upper=self.MAX_VALUE, step_incr=0, page_incr=0, page_size=0)
        self.volume_scale = Gtk.HScale(adjustment=adjustment)
        self.volume_scale.connect("value-changed", self.on_value_changed)
        self.volume_scale.connect("scroll-event", self.on_scroll_event)
        self.volume_scale.connect("button-press-event", self.on_volume_change)
        self.volume_scale.set_size_request(200, -1)
        self.volume_scale.set_digits(1)
        self.volume_scale.set_draw_value(False)

        self.pack_start(self.volume_scale, False, False, 0)

        self.show_all()
开发者ID:Andresteve07,项目名称:foobnix,代码行数:16,代码来源:volume.py

示例8: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)
        Gtk.Window.__init__(self, Gtk.WindowType.TOPLEVEL)

        self.set_title("Foobnix " + FOOBNIX_VERSION)
        self.set_position(Gtk.WindowPosition.CENTER)
        self.set_resizable(True)
        self.connect("window-state-event", self.on_change_state)
        self.connect("delete-event", self.hide_window)
        self.connect("key-press-event", self.on_key_press)
        try:
            self.set_icon_name(const.ICON_FOOBNIX_NAME)
        except TypeError as e:
            logging.error(str(e))

        self.set_opacity(FC().window_opacity)
        self.iconified = False
开发者ID:zavlab1,项目名称:foobnix,代码行数:17,代码来源:window.py

示例9: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)
        self.controls = controls
        """ set application stylesheet"""
        self.style_provider = Gtk.CssProvider()
        ## TODO: after moving style to resource - replace to load_from_file
        self.style_provider.load_from_data(foobnix_style)
        Gtk.StyleContext.add_provider_for_screen(
            Gdk.Screen.get_default(),
            self.style_provider,
            Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
        )

        self.controls = controls

        notebox = Gtk.Overlay.new()
        notebox.add(controls.notetabs)
        notebox.add_overlay(controls.search_progress)

        bbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        bbox.pack_start(notebox, True, True, 0)

        center_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        center_box.pack_start(controls.searchPanel, False, False, 0)
        center_box.pack_start(bbox, True, True, 0)

        self.hpaned_left = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
        self.hpaned_left.pack1(child=controls.perspectives.scroll, resize=True, shrink=False)
        self.hpaned_left.pack2(child=center_box, resize=True, shrink=True)

        self.hpaned_right = Gtk.Paned.new(Gtk.Orientation.HORIZONTAL)
        self.hpaned_right.pack1(child=self.hpaned_left, resize=True, shrink=True)
        self.hpaned_right.pack2(child=controls.coverlyrics, resize=True, shrink=False)

        vbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        vbox.pack_start(controls.top_panel, False, False, 0)
        vbox.pack_start(self.hpaned_right, True, True, 0)
        vbox.pack_start(controls.statusbar, False, True, 0)
        vbox.show_all()

        self.hpaned_left.connect("button-release-event", self.on_border_release)
        self.hpaned_right.connect("button-release-event", self.on_border_release)

        controls.main_window.connect("configure-event", self.on_configure_event)
        controls.main_window.add(vbox)
开发者ID:zavlab1,项目名称:foobnix,代码行数:45,代码来源:base_layout.py

示例10: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)

        box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        box.hide()
        box.pack_start(self.tabs_mode(), False, True, 0)
        box.pack_start(self.dirs(), False, True, 0)
        box.pack_start(self.formats(), False, True, 0)

        self.widget = box
        uhbox = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
        ulabel = Gtk.Label.new(_("Update library on start (more slow) "))
        self.update_on_start = Gtk.CheckButton.new()

        uhbox.pack_start(ulabel, False, True, 0)
        uhbox.pack_start(self.update_on_start, False, False, 0)
        box.pack_start(uhbox, False, True, 0)
        box.pack_start(self.gap(), False, True, 0)
开发者ID:foobnix,项目名称:foobnix,代码行数:18,代码来源:music_library.py

示例11: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)

        box = Gtk.VBox(False, 0)
        box.hide()
        box.pack_start(self.tabs_mode(), False, True, 0)
        box.pack_start(self.dirs(), False, True, 0)
        box.pack_start(self.formats(), False, True, 0)

        self.widget = box
        uhbox = Gtk.HBox()
        ulabel = Gtk.Label(_("Update library on start (more slow) "))
        self.update_on_start = Gtk.CheckButton()

        uhbox.pack_start(ulabel, False, True, 0)
        uhbox.pack_start(self.update_on_start, False, False, 0)
        box.pack_start(uhbox, False, True, 0)
        box.pack_start(self.gap(), False, True, 0)
开发者ID:zablotski,项目名称:foobnix,代码行数:18,代码来源:music_library.py

示例12: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)

        controls = self.controls
        self.configs.append(MusicLibraryConfig(controls))
        self.configs.append(TabsConfig(controls))
        self.configs.append(LastFmConfig(controls))
        self.configs.append(TrayIconConfig(controls))
        self.configs.append(NetworkConfig(controls))

        try:
            """check keybinder installed, debian"""
            import gi
            gi.require_version('Keybinder', '3.0')
            from gi.repository import Keybinder #@UnresolvedImport @UnusedImport
            from foobnix.preferences.configs.hotkey_conf import HotKeysConfig
            self.configs.append(HotKeysConfig(controls))
        except Exception, e:
            logging.warn("Keybinder not installed" + str(e))
开发者ID:foobnix,项目名称:foobnix,代码行数:19,代码来源:preferences_window.py

示例13: __init__

    def __init__(self, controls):
        FControl.__init__(self, controls)
        Gtk.StatusIcon.__init__(self)
        self.hide()
        ImageBase.__init__(self, ICON_FOOBNIX, 150)

        self.popup_menu = PopupMenuWindow(self.controls)
        self.popup_volume_contol = PopupVolumeWindow(self.controls, self.popup_menu)

        self.connect("activate", self.on_activate)
        self.connect("popup-menu", self.on_popup_menu)

        try:
            self.set_has_tooltip(True)
            #self.set_tooltip("Foobnix music player")
            self.connect("query-tooltip", self.on_query_tooltip)
            self.connect("button-press-event", self.on_button_press)
            self.connect("scroll-event", self.on_scroll)
        except Exception, e:
            logging.warn("Tooltip doesn't work " + str(e))
开发者ID:foobnix,项目名称:foobnix,代码行数:20,代码来源:tray_icon.py

示例14: __init__

    def __init__(self, controls):
        FilterTreeControls.__init__(self, controls)

        FTreeModel.__init__(self)
        FControl.__init__(self, controls)

        self.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE)
        self.set_enable_tree_lines(True)

        """model config"""
        self.model = MyTreeStore(*FTreeModel().types())

        """filter config"""
        self.filter_model = self.model.filter_new()
        self.filter_model.set_visible_column(self.visible[0])
        self.set_model(self.filter_model)

        """connectors"""
        self.connect("button-press-event", self.on_button_press)
        self.connect("key-release-event", self.on_key_release)
        self.connect("row-expanded", self.on_row_expanded)
        self.connect('button_press_event', self.on_multi_button_press)
        self.connect('button_release_event', self.on_multi_button_release)

        self.count_index = 0

        self.set_reorderable(False)
        self.set_headers_visible(False)

        self.ellipsize_render = Gtk.CellRendererText.new()
        self.ellipsize_render.set_property('ellipsize', Pango.EllipsizeMode.END)

        self.set_type_plain()

        self.active_UUID = -1

        self.defer_select = False

        self.scroll = Gtk.ScrolledWindow()
        self.scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
        self.scroll.add(self)
开发者ID:foobnix,项目名称:foobnix,代码行数:41,代码来源:common_tree.py

示例15: __init__

    def __init__(self, controls, callback):
        self.callback = callback
        FControl.__init__(self, controls)
        ChildTopWindow.__init__(self, _("Equalizer"))

        self.combo = Gtk.ComboBoxText.new_with_entry()
        self.combo.connect("changed", self.on_combo_change)

        self.eq_lines = []
        for label in EQUALIZER_LABLES:
            self.eq_lines.append(EqLine(label, self.on_callback))

        lbox = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        lbox.show()

        lbox.pack_start(self.top_row(), False, False, 0)
        lbox.pack_start(self.middle_lines_box(), False, False, 0)

        self.add(lbox)

        self.models = []
        self.default_models = []
开发者ID:foobnix,项目名称:foobnix,代码行数:22,代码来源:eq_gui.py


注:本文中的foobnix.gui.model.signal.FControl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。