本文整理汇总了Python中gtk.Table方法的典型用法代码示例。如果您正苦于以下问题:Python gtk.Table方法的具体用法?Python gtk.Table怎么用?Python gtk.Table使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gtk
的用法示例。
在下文中一共展示了gtk.Table方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createPanelSettingsWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createPanelSettingsWidgets(self):
"""Create the Panel Settings widgets."""
self.tablePanelSettings = gtk.Table(rows=5, columns=3, homogeneous=False)
self.tablePanelSettings.set_row_spacings(5)
self.tablePanelSettings.set_col_spacings(5)
createLabel(self.tablePanelSettings, text="Window Manager Menu", gridX=0, gridY=0, xPadding=10)
self.panelMenu = createCheckButton(self.tablePanelSettings, active=False, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("wm_menu", self.panelMenu)
createLabel(self.tablePanelSettings, text="Place In Window Manager Dock", gridX=0, gridY=1, xPadding=10)
self.panelDock = createCheckButton(self.tablePanelSettings, active=False, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_dock", self.panelDock)
createLabel(self.tablePanelSettings, text="Panel Layer", gridX=0, gridY=2, xPadding=10)
self.panelLayer = createComboBox(self.tablePanelSettings, ["bottom", "top", "normal"], gridX=1, gridY=2, handler=self.changeOccurred)
self.registerComponent("panel_layer", self.panelLayer)
createLabel(self.tablePanelSettings, text="Strut Policy", gridX=0, gridY=3, xPadding=10)
self.panelAutohideStrut = createComboBox(self.tablePanelSettings, ["none", "minimum", "follow_size"], gridX=1, gridY=3, handler=self.changeOccurred)
self.registerComponent("strut_policy", self.panelAutohideStrut)
createLabel(self.tablePanelSettings, text="Panel Monitor (all, 1, 2, ...)", gridX=0, gridY=4, xPadding=10)
self.panelMonitor = createEntry(self.tablePanelSettings, maxSize=6, width=8, text=PANEL_MONITOR, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_monitor", self.panelMonitor)
示例2: createPanelAutohideWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createPanelAutohideWidgets(self):
"""Create the Panel Autohide widgets."""
self.tablePanelAutohide = gtk.Table(rows=4, columns=3, homogeneous=False)
self.tablePanelAutohide.set_row_spacings(5)
self.tablePanelAutohide.set_col_spacings(5)
createLabel(self.tablePanelAutohide, text="Autohide Panel", gridX=0, gridY=0, xPadding=10)
self.panelAutohide = createCheckButton(self.tablePanelAutohide, active=False, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide", self.panelAutohide)
createLabel(self.tablePanelAutohide, text="Autohide Show Timeout (seconds)", gridX=0, gridY=1, xPadding=10)
self.panelAutohideShow = createEntry(self.tablePanelAutohide, maxSize=6, width=8, text=PANEL_AUTOHIDE_SHOW, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide_show_timeout", self.panelAutohideShow)
createLabel(self.tablePanelAutohide, text="Autohide Hide Timeout (seconds)", gridX=0, gridY=2, xPadding=10)
self.panelAutohideHide = createEntry(self.tablePanelAutohide, maxSize=6, width=8, text=PANEL_AUTOHIDE_HIDE, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide_hide_timeout", self.panelAutohideHide)
createLabel(self.tablePanelAutohide, text="Autohide Hidden Height", gridX=0, gridY=3, xPadding=10)
self.panelAutohideHeight = createEntry(self.tablePanelAutohide, maxSize=6, width=8, text=PANEL_AUTOHIDE_HEIGHT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("autohide_height", self.panelAutohideHeight)
示例3: createMouseWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createMouseWidgets(self):
"""Creates the Mouse widgets."""
self.tableMouse = gtk.Table(rows=4, columns=3, homogeneous=False)
self.tableMouse.set_row_spacings(5)
self.tableMouse.set_col_spacings(5)
mouseCmds = ["none", "close", "toggle", "iconify", "shade", "toggle_iconify", "maximize_restore", "desktop_left", "desktop_right", "next_task", "prev_task"]
createLabel(self.tableMouse, text="Middle Mouse Click Action", gridX=0, gridY=0, xPadding=10)
self.mouseMiddle = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("mouse_middle", self.mouseMiddle)
createLabel(self.tableMouse, text="Right Mouse Click Action", gridX=0, gridY=1, xPadding=10)
self.mouseRight = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=1, handler=self.changeOccurred)
self.registerComponent("mouse_right", self.mouseRight)
createLabel(self.tableMouse, text="Mouse Wheel Scroll Up Action", gridX=0, gridY=2, xPadding=10)
self.mouseUp = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=2, handler=self.changeOccurred)
self.registerComponent("mouse_scroll_up", self.mouseUp)
createLabel(self.tableMouse, text="Mouse Wheel Scroll Down Action", gridX=0, gridY=3, xPadding=10)
self.mouseDown = createComboBox(self.tableMouse, mouseCmds, gridX=1, gridY=3, handler=self.changeOccurred)
self.registerComponent("mouse_scroll_down", self.mouseDown)
示例4: _create_command_dialog
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def _create_command_dialog(self, enabled_var = False, name_var = "", command_var = ""):
dialog = gtk.Dialog(
_("New Command"),
None,
gtk.DIALOG_MODAL,
(
gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT
)
)
table = gtk.Table(3, 2)
label = gtk.Label(_("Enabled:"))
table.attach(label, 0, 1, 0, 1)
enabled = gtk.CheckButton()
enabled.set_active(enabled_var)
table.attach(enabled, 1, 2, 0, 1)
label = gtk.Label(_("Name:"))
table.attach(label, 0, 1, 1, 2)
name = gtk.Entry()
name.set_text(name_var)
table.attach(name, 1, 2, 1, 2)
label = gtk.Label(_("Command:"))
table.attach(label, 0, 1, 2, 3)
command = gtk.Entry()
command.set_text(command_var)
table.attach(command, 1, 2, 2, 3)
dialog.vbox.pack_start(table)
dialog.show_all()
return (dialog,enabled,name,command)
示例5: createPanelDisplayWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createPanelDisplayWidgets(self):
"""Create the Panel Display widgets."""
self.tablePanelDisplay = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tablePanelDisplay.set_row_spacings(5)
self.tablePanelDisplay.set_col_spacings(5)
createLabel(self.tablePanelDisplay, text="Position", gridX=0, gridY=0, xPadding=10)
self.panelPosY = createComboBox(self.tablePanelDisplay, ["bottom", "top", "center"], gridX=1, gridY=0, handler=self.changeOccurred)
self.panelPosX = createComboBox(self.tablePanelDisplay, ["left", "right", "center"], gridX=2, gridY=0, handler=self.changeOccurred)
# Note: registered below
createLabel(self.tablePanelDisplay, text="Panel Orientation", gridX=0, gridY=1, xPadding=10)
self.panelOrientation = createComboBox(self.tablePanelDisplay, ["horizontal", "vertical"], gridX=1, gridY=1, handler=self.changeOccurred)
self.registerComponent("panel_position", (self.panelPosY, self.panelPosX, self.panelOrientation))
self.panelSizeLabel = createLabel(self.tablePanelDisplay, text="Size (width, height)", gridX=0, gridY=2, xPadding=10)
self.panelSizeX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_SIZE_X, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.panelSizeY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_SIZE_Y, gridX=2, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_size", (self.panelSizeX, self.panelSizeY))
createLabel(self.tablePanelDisplay, text="Margin (x, y)", gridX=0, gridY=3, xPadding=10)
self.panelMarginX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_MARGIN_X, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.panelMarginY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_MARGIN_Y, gridX=2, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_margin", (self.panelMarginX, self.panelMarginY))
createLabel(self.tablePanelDisplay, text="Padding (x, y)", gridX=0, gridY=4, xPadding=10)
self.panelPadX = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_PADDING_X, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.panelPadY = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=PANEL_PADDING_Y, gridX=2, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tablePanelDisplay, text="Horizontal Spacing", gridX=0, gridY=5, xPadding=10)
self.panelSpacing = createEntry(self.tablePanelDisplay, maxSize=6, width=8, text=TASKBAR_SPACING, gridX=1, gridY=5, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("panel_padding", (self.panelPadX, self.panelPadY, self.panelSpacing))
createLabel(self.tablePanelDisplay, text="Panel Background ID", gridX=0, gridY=6, xPadding=10)
self.panelBg = createComboBox(self.tablePanelDisplay, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=6, handler=self.changeOccurred)
self.registerComponent("panel_background_id", self.panelBg)
示例6: createTaskbarWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createTaskbarWidgets(self):
"""Create the Taskbar widgets."""
self.tableTaskbar = gtk.Table(rows=5, columns=3, homogeneous=False)
self.tableTaskbar.set_row_spacings(5)
self.tableTaskbar.set_col_spacings(5)
createLabel(self.tableTaskbar, text="Taskbar Mode", gridX=0, gridY=0, xPadding=10)
self.taskbarMode = createComboBox(self.tableTaskbar, ["single_desktop", "multi_desktop"], gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("taskbar_mode", self.taskbarMode)
createLabel(self.tableTaskbar, text="Padding (x, y)", gridX=0, gridY=1, xPadding=10)
self.taskbarPadX = createEntry(self.tableTaskbar, maxSize=6, width=8, text=TASKBAR_PADDING_X, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.taskbarPadY = createEntry(self.tableTaskbar, maxSize=6, width=8, text=TASKBAR_PADDING_Y, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskbar, text="Horizontal Spacing", gridX=0, gridY=2, xPadding=10)
self.taskbarSpacing = createEntry(self.tableTaskbar, maxSize=6, width=8, text=TASK_SPACING, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("taskbar_padding", (self.taskbarPadX, self.taskbarPadY, self.taskbarSpacing))
createLabel(self.tableTaskbar, text="Taskbar Background ID", gridX=0, gridY=3, xPadding=10)
self.taskbarBg = createComboBox(self.tableTaskbar, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=3, handler=self.changeOccurred)
self.registerComponent("taskbar_background_id", self.taskbarBg)
createLabel(self.tableTaskbar, text="Active Taskbar Background ID", gridX=0, gridY=4, xPadding=10)
self.taskbarActiveBg = createComboBox(self.tableTaskbar, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=4, handler=self.changeOccurred)
self.taskbarActiveBgEnable = createCheckButton(self.tableTaskbar, text="Enable", active=False, gridX=2, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("taskbar_active_background_id", self.taskbarActiveBg)
示例7: createNormalTasksWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createNormalTasksWidgets(self):
"""Create the Normal Tasks widgets."""
self.tableTaskDefault = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskDefault.set_row_spacings(5)
self.tableTaskDefault.set_col_spacings(5)
createLabel(self.tableTaskDefault, text="Normal Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskBg = createComboBox(self.tableTaskDefault, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_background_id", self.taskBg)
createLabel(self.tableTaskDefault, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
createLabel(self.tableTaskDefault, text="Normal Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.iconHue = createEntry(self.tableTaskDefault, maxSize=6, width=8, text=ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskDefault, text="Normal Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.iconSat = createEntry(self.tableTaskDefault, maxSize=6, width=8, text=ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskDefault, text="Normal Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.iconBri = createEntry(self.tableTaskDefault, maxSize=6, width=8, text=ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_icon_asb", (self.iconHue, self.iconSat, self.iconBri))
createLabel(self.tableTaskDefault, text="Normal Font Color", gridX=0, gridY=5, xPadding=10)
self.fontCol = createEntry(self.tableTaskDefault, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontCol")
self.fontCol.connect("activate", self.colorTyped)
self.fontColButton = createColorButton(self.tableTaskDefault, color=self.defaults["fgColor"], useAlpha=True, name="fontCol", gridX=2, gridY=5, handler=self.colorChange)
self.fontCol.set_text(self.defaults["fgColor"])
# Add this AFTER we set color to avoid "changed" event
self.fontCol.connect("changed", self.changeOccurred)
self.registerComponent("task_font_color", (self.fontCol, self.fontColButton))
示例8: createActiveTasksWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createActiveTasksWidgets(self):
"""Create the Active Tasks widgets."""
self.tableTaskActive = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskActive.set_row_spacings(5)
self.tableTaskActive.set_col_spacings(5)
createLabel(self.tableTaskActive, text="Active Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskActiveBg = createComboBox(self.tableTaskActive, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_active_background_id", self.taskActiveBg)
createLabel(self.tableTaskActive, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
createLabel(self.tableTaskActive, text="Active Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.activeIconHue = createEntry(self.tableTaskActive, maxSize=6, width=8, text=ACTIVE_ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskActive, text="Active Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.activeIconSat = createEntry(self.tableTaskActive, maxSize=6, width=8, text=ACTIVE_ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskActive, text="Active Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.activeIconBri = createEntry(self.tableTaskActive, maxSize=6, width=8, text=ACTIVE_ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_active_icon_asb", (self.activeIconHue, self.activeIconSat, self.activeIconBri))
createLabel(self.tableTaskActive, text="Active Font Color", gridX=0, gridY=5, xPadding=10)
self.fontActiveCol = createEntry(self.tableTaskActive, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontActiveCol")
self.fontActiveCol.connect("activate", self.colorTyped)
self.fontActiveColButton = createColorButton(self.tableTaskActive, color=self.defaults["fgColor"], useAlpha=True, name="fontActiveCol", gridX=2, gridY=5, handler=self.colorChange)
self.fontActiveCol.set_text(self.defaults["fgColor"])
# Add this AFTER we set color to avoid "changed" event
self.fontActiveCol.connect("changed", self.changeOccurred)
self.registerComponent("task_active_font_color", (self.fontActiveCol, self.fontActiveColButton))
示例9: createUrgentTasksWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createUrgentTasksWidgets(self):
"""Create the Urgent Tasks widgets."""
self.tableTaskUrgent = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskUrgent.set_row_spacings(5)
self.tableTaskUrgent.set_col_spacings(5)
createLabel(self.tableTaskUrgent, text="Urgent Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskUrgentBg = createComboBox(self.tableTaskUrgent, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_urgent_background_id", self.taskUrgentBg)
createLabel(self.tableTaskUrgent, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
createLabel(self.tableTaskUrgent, text="Urgent Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.urgentIconHue = createEntry(self.tableTaskUrgent, maxSize=6, width=8, text=URGENT_ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskUrgent, text="Urgent Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.urgentIconSat = createEntry(self.tableTaskUrgent, maxSize=6, width=8, text=URGENT_ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskUrgent, text="Urgent Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.urgentIconBri = createEntry(self.tableTaskUrgent, maxSize=6, width=8, text=URGENT_ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_urgent_icon_asb", (self.urgentIconHue, self.urgentIconSat, self.urgentIconBri))
createLabel(self.tableTaskUrgent, text="Urgent Font Color", gridX=0, gridY=5, xPadding=10)
self.fontUrgentCol = createEntry(self.tableTaskUrgent, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontUrgentCol")
self.fontUrgentCol.connect("activate", self.colorTyped)
self.fontUrgentColButton = createColorButton(self.tableTaskUrgent, color=self.defaults["fgColor"], useAlpha=True, name="fontUrgentCol", gridX=2, gridY=5, handler=self.colorChange)
self.fontUrgentCol.set_text(self.defaults["fgColor"])
# Add this AFTER we set color to avoid "changed" event
self.fontUrgentCol.connect("changed", self.changeOccurred)
self.registerComponent("task_urgent_font_color", (self.fontUrgentCol, self.fontUrgentColButton))
示例10: createIconifiedTasksWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createIconifiedTasksWidgets(self):
"""Create the Iconified Tasks widgets."""
self.tableTaskIconified = gtk.Table(rows=6, columns=3, homogeneous=False)
self.tableTaskIconified.set_row_spacings(5)
self.tableTaskIconified.set_col_spacings(5)
createLabel(self.tableTaskIconified, text="Iconified Task Background ID", gridX=0, gridY=0, xPadding=10)
self.taskIconifiedBg = createComboBox(self.tableTaskIconified, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=0, handler=self.changeOccurred)
self.registerComponent("task_iconified_background_id", self.taskIconifiedBg)
createLabel(self.tableTaskIconified, text="Note: Default values of 0 for each of these settings leaves icons unchanged!", gridX=0, gridY=1, sizeX=3, xPadding=10)
createLabel(self.tableTaskIconified, text="Iconified Icon Alpha (0 to 100)", gridX=0, gridY=2, xPadding=10)
self.iconifiedIconHue = createEntry(self.tableTaskIconified, maxSize=6, width=8, text=ICONIFIED_ICON_ALPHA, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskIconified, text="Iconified Icon Saturation (-100 to 100)", gridX=0, gridY=3, xPadding=10)
self.iconifiedIconSat = createEntry(self.tableTaskIconified, maxSize=6, width=8, text=ICONIFIED_ICON_SAT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
# Note: added below
createLabel(self.tableTaskIconified, text="Iconified Icon Brightness (-100 to 100)", gridX=0, gridY=4, xPadding=10)
self.iconifiedIconBri = createEntry(self.tableTaskIconified, maxSize=6, width=8, text=ICONIFIED_ICON_BRI, gridX=1, gridY=4, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("task_iconified_icon_asb", (self.iconifiedIconHue, self.iconifiedIconSat, self.iconifiedIconBri))
createLabel(self.tableTaskIconified, text="Iconified Font Color", gridX=0, gridY=5, xPadding=10)
self.fontIconifiedCol = createEntry(self.tableTaskIconified, maxSize=7, width=9, text="", gridX=1, gridY=5, xExpand=True, yExpand=False, handler=None, name="fontIconifiedCol")
self.fontIconifiedCol.connect("activate", self.colorTyped)
self.fontIconifiedColButton = createColorButton(self.tableTaskIconified, color=self.defaults["fgColor"], useAlpha=True, name="fontIconifiedCol", gridX=2, gridY=5, handler=self.colorChange)
self.fontIconifiedCol.set_text(self.defaults["fgColor"])
# Add this AFTER we set color to avoid "changed" event
self.fontIconifiedCol.connect("changed", self.changeOccurred)
self.registerComponent("task_iconified_font_color", (self.fontIconifiedCol, self.fontIconifiedColButton))
示例11: createTooltipsWidgets
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def createTooltipsWidgets(self):
"""Creates the Tooltips widgets."""
self.tableTooltip = gtk.Table(rows=7, columns=3, homogeneous=False)
self.tableTooltip.set_row_spacings(5)
self.tableTooltip.set_col_spacings(5)
createLabel(self.tableTooltip, text="Show Tooltips", gridX=0, gridY=0, xPadding=10)
self.tooltipShow = createCheckButton(self.tableTooltip, active=False, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip", self.tooltipShow)
createLabel(self.tableTooltip, text="Padding (x, y)", gridX=0, gridY=1, xPadding=10)
self.tooltipPadX = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_PADDING_X, gridX=1, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.tooltipPadY = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_PADDING_Y, gridX=2, gridY=1, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip_padding", (self.tooltipPadX, self.tooltipPadY))
createLabel(self.tableTooltip, text="Tooltip Show Timeout (seconds)", gridX=0, gridY=2, xPadding=10)
self.tooltipShowTime = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_SHOW_TIMEOUT, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip_show_timeout", self.tooltipShowTime)
createLabel(self.tableTooltip, text="Tooltip Hide Timeout (seconds)", gridX=0, gridY=3, xPadding=10)
self.tooltipHideTime = createEntry(self.tableTooltip, maxSize=6, width=8, text=TOOLTIP_HIDE_TIMEOUT, gridX=1, gridY=3, xExpand=True, yExpand=False, handler=self.changeOccurred)
self.registerComponent("tooltip_hide_timeout", self.tooltipHideTime)
createLabel(self.tableTooltip, text="Tooltip Background ID", gridX=0, gridY=4, xPadding=10)
self.tooltipBg = createComboBox(self.tableTooltip, ["0 (fully transparent)"] + range(1, len(self.bgs)), gridX=1, gridY=4, handler=self.changeOccurred)
self.registerComponent("tooltip_background_id", self.tooltipBg)
createLabel(self.tableTooltip, text="Tooltip Font", gridX=0, gridY=5, xPadding=10)
self.tooltipFont = createFontButton(self.tableTooltip, font=self.defaults["font"], gridX=1, gridY=5, handler=self.changeOccurred)
self.registerComponent("tooltip_font", self.tooltipFont)
createLabel(self.tableTooltip, text="Tooltip Font Color", gridX=0, gridY=6, xPadding=10)
self.tooltipFontCol = createEntry(self.tableTooltip, maxSize=7, width=9, text="", gridX=1, gridY=6, xExpand=True, yExpand=False, handler=None, name="tooltipFontCol")
self.tooltipFontCol.connect("activate", self.colorTyped)
self.tooltipFontColButton = createColorButton(self.tableTooltip, color=self.defaults["fgColor"], useAlpha=True, name="tooltipFontCol", gridX=2, gridY=6, handler=self.colorChange)
self.tooltipFontCol.set_text(self.defaults["fgColor"])
# Add this AFTER we set color to avoid "changed" event
self.tooltipFontCol.connect("changed", self.changeOccurred)
self.registerComponent("tooltip_font_color", (self.tooltipFontCol, self.tooltipFontColButton))
示例12: addBg
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def addBg(self):
"""Adds a new background to the list of backgrounds."""
self.bgs += [gtk.Table(4, 3, False)]
createLabel(self.bgs[-1], text="Corner Rounding (px)", gridX=0, gridY=0, xPadding=10)
createEntry(self.bgs[-1], maxSize=7, width=9, text=BG_ROUNDING, gridX=1, gridY=0, xExpand=True, yExpand=False, handler=self.changeOccurred, name="rounded")
createLabel(self.bgs[-1], text="Background Color", gridX=0, gridY=1, xPadding=10)
temp = gtk.Entry(7)
temp.set_width_chars(9)
temp.set_name("bgColEntry")
temp.set_text(self.defaults["bgColor"])
temp.connect("changed", self.changeOccurred)
temp.connect("activate", self.colorTyped)
self.bgs[-1].attach(temp, 1, 2, 1, 2, xoptions=gtk.EXPAND)
temp = gtk.ColorButton(gtk.gdk.color_parse(self.defaults["bgColor"]))
temp.set_use_alpha(True)
temp.set_name("bgCol")
temp.connect("color-set", self.colorChange)
self.bgs[-1].attach(temp, 2, 3, 1, 2, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
createLabel(self.bgs[-1], text="Border Width (px)", gridX=0, gridY=2, xPadding=10)
createEntry(self.bgs[-1], maxSize=7, width=9, text=BG_BORDER, gridX=1, gridY=2, xExpand=True, yExpand=False, handler=self.changeOccurred, name="border")
createLabel(self.bgs[-1], text="Border Color", gridX=0, gridY=3, xPadding=10)
temp = gtk.Entry(7)
temp.set_width_chars(9)
temp.set_name("borderColEntry")
temp.connect("activate", self.colorTyped)
temp.set_text(self.defaults["borderColor"])
temp.connect("changed", self.changeOccurred)
self.bgs[-1].attach(temp, 1, 2, 3, 4, xoptions=gtk.EXPAND)
temp = gtk.ColorButton(gtk.gdk.color_parse(self.defaults["borderColor"]))
temp.set_use_alpha(True)
temp.set_name("borderCol")
temp.connect("color-set", self.colorChange)
self.bgs[-1].attach(temp, 2, 3, 3, 4, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
# Note: Only set init to True when initialising background styles.
# This prevents unwanted calls to changeOccurred()
示例13: show_dialog
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def show_dialog(self, title, surname, group):
labelSurname = gtk.Label(_("Surname"))
entrySurname = gtk.Entry()
if surname:
entrySurname.set_text(surname)
labelGroup = gtk.Label(_("Group"))
entryGroup = gtk.Entry()
if group:
entryGroup.set_text(group)
dialog = gtk.Dialog(title,
None,
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
table = gtk.Table(2, 2)
table.attach(labelSurname, 0, 1, 0, 1, xoptions=gtk.SHRINK, yoptions=gtk.EXPAND, xpadding=5, ypadding=5)
table.attach(labelGroup, 0, 1, 1, 2, xoptions=gtk.SHRINK, yoptions=gtk.EXPAND, xpadding=5, ypadding=5)
table.attach(entrySurname, 1, 2, 0, 1, xoptions=gtk.FILL, yoptions=gtk.EXPAND, xpadding=5, ypadding=5)
table.attach(entryGroup, 1, 2, 1, 2, xoptions=gtk.FILL, yoptions=gtk.EXPAND, xpadding=5, ypadding=5)
dialog.vbox.pack_start(table, fill=True, expand=True)
dialog.show_all()
response = dialog.run()
if response == gtk.RESPONSE_ACCEPT:
result = (entrySurname.get_text(), entryGroup.get_text())
else:
result = None
dialog.destroy()
return result
示例14: _setup_table
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def _setup_table(self):
"""Called by __init__ to set up my main table.
You can easily override me instead of clobbering __init__.
"""
table = gtk.Table(len(self.propertyLabels), 2)
self.container.add(table)
table.set_name("PropertyTable")
self.subtable['properties'] = table
row = 0
for p, name in self.propertyLabels:
label = gtk.Label(name)
label.set_name("PropertyName")
label.set_data("property", p)
table.attach(label, 0, 1, row, row + 1)
label.set_alignment(0, 0)
row = row + 1
# XXX: make these guys collapsable
for g, name in self.groupLabels:
table = gtk.Table(1, 2)
self.container.add(table)
table.set_name("AttributeGroupTable")
self.subtable[g] = table
label = gtk.Label(name)
label.set_name("AttributeGroupTitle")
table.attach(label, 0, 2, 0, 1)
示例15: __init__
# 需要导入模块: import gtk [as 别名]
# 或者: from gtk import Table [as 别名]
def __init__(self, tw):
"""Create and shows the window."""
self.tw = tw
# Create top-level window
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
self.set_title("Preferences")
self.connect("delete_event", self.quit)
self.layout = gtk.Table(2, 2, False)
self.table = gtk.Table(5, 2, False)
self.table.set_row_spacings(5)
self.table.set_col_spacings(5)
createLabel(self.table, text="Default Font", gridX=0, gridY=0)
self.font = gtk.FontButton(self.tw.defaults["font"])
self.font.set_alignment(0, 0.5)
self.table.attach(self.font, 1, 2, 0, 1, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
createLabel(self.table, text="Default Background Color", gridX=0, gridY=1)
self.bgColor = gtk.ColorButton(gtk.gdk.color_parse(self.tw.defaults["bgColor"]))
self.bgColor.set_alignment(0, 0.5)
self.table.attach(self.bgColor, 1, 2, 1, 2, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
createLabel(self.table, text="Default Foreground Color", gridX=0, gridY=2)
self.fgColor = gtk.ColorButton(gtk.gdk.color_parse(self.tw.defaults["fgColor"]))
self.fgColor.set_alignment(0, 0.5)
self.table.attach(self.fgColor, 1, 2, 2, 3, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
createLabel(self.table, text="Default Border Color", gridX=0, gridY=3)
self.borderColor = gtk.ColorButton(gtk.gdk.color_parse(self.tw.defaults["borderColor"]))
self.borderColor.set_alignment(0, 0.5)
self.table.attach(self.borderColor, 1, 2, 3, 4, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND)
createLabel(self.table, text="Number of background styles", gridX=0, gridY=4)
self.bgCount = createEntry(self.table, maxSize=6, width=8, text=str(self.tw.defaults["bgCount"]), gridX=1, gridY=4, xExpand=True, yExpand=True)
self.layout.attach(self.table, 0, 2, 0, 1, xoptions=gtk.EXPAND, yoptions=gtk.EXPAND, xpadding=20, ypadding=5)
createButton(self.layout, text="Save", stock=gtk.STOCK_SAVE, name="save", gridX=0, gridY=1, xExpand=True, yExpand=True, handler=self.save)
createButton(self.layout, text="Cancel", stock=gtk.STOCK_CANCEL, name="cancel", gridX=1, gridY=1, xExpand=True, yExpand=True, handler=self.quit)
self.add(self.layout)
self.show_all()