- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我有这个gtk.VScale,如何更改 slider 的图标及其背景?
预期:
错误:
代码:
import sys,os
import pygtk, gtk, gobject
class GTK_Main:
def __init__(self):
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("Test")
window.set_default_size(500, 400)
window.connect("destroy", gtk.main_quit, "WM destroy")
hbox_eq = gtk.HBox()
hbox_eq.set_size_request(200, 150)
self.hscale_one = gtk.VScale()# gtk.HScale()
self.hscale_one.set_range(-24, 12)
hbox_eq.pack_start(self.hscale_one, True, True, 0)
self.hscale_two = gtk.VScale()# gtk.HScale()
self.hscale_two.set_range(-24, 12)
hbox_eq.pack_start(self.hscale_two, True, True, 0)
vbox = gtk.VBox()
vbox.pack_start(hbox_eq, False)
window.add(vbox)
window.show_all()
def exit(self, widget, data=None):
gtk.main_quit()
GTK_Main()
gtk.gdk.threads_init()
gtk.main()
编辑:黑客风格
gtk-toolbar-icon-size = small-toolbar
gtk-icon-sizes = "panel-menu=16,16:panel=8,8:gtk-button=16,16:gtk-large-toolbar=24,24:gtk-small-toolbar=16,16"
gtk-menu-popup-delay = 1
gtk-enable-animations = 1
gtk-tooltip-timeout = 970
style "default"
{
GtkWidget::interior_focus = 7
GtkWidget::focus_padding = 0
GtkButton::child-displacement-x = 0
GtkButton::child-displacement-y = 1
GtkButton::default_border = { 0, 0, 0, 0 }
GtkButton::default_outside_border = { 0, 0, 0, 0 }
GtkButton::focus-padding = 0
#GtkButton::inner-border = {0, 0, 0, 0}
#GtkButton::button-relief = GTK_RELIEF_NONE
#GtkButton::displace-focus = 1
#GtkButton::shadow_type = GTK_SHADOW_NONE
#GtkButton::image-spacing = 2
#GtkButton::focus-padding = 0
#GtkButtonBox::child_min_width = 0
#GtkButtonBox::child_min_heigth = 0
#GtkButtonBox::child_internal_pad_x = 0
#GtkButtonBox::child_internal_pad_y = 0
#GtkColorButton::default_border = {0, 0, 0, 0}
#GtkColorButton::child-displacement-y = 1
#GtkComboBox::appears-as-list = 1
#GtkComboBox::arrow-size = 10
#GtkComboBox::shadow_type = GTK_SHADOW_OUT
#GtkComboBoxEntry::appears-as-list = 1
GtkNotebook::tab-overlap = -2
#GtkNotebook::tab-curvature = 5
#GimpColorNotebook::tab-border = 1
#GimpDockSeparator::height = 10
GtkVScale::slider_length = 14
GtkVScale::slider_width = 15
GtkVScale::focus-padding = 4
GtkVScale::trough-side-details = 0
#GtkVScale::trough-border = 1
#GtkVScale::value-spacing = 0
#GtkVScale::trough-under-steppers = 0
#GtkVScale::arrow-displacement-x = 0
#GtkVScale::arrow-displacement-y = 0
#GtkVScale::activate_slider = 0
GtkHScale::trough-side-details = 0
GtkHScale::focus-padding = 4
GtkHScale::slider_length = 10
GtkHScale::slider_width = 19
#GtkHScale::trough-border = 1
#GtkHScale::value-spacing = 0
#GtkHScale::trough-under-steppers = 0
#GtkHScale::arrow-displacement-x = 0
#GtkHScale::arrow-displacement-y = 0
#GtkHScale::activate_slider = 0
GtkArrow::arrow-scaling = 0.4
GtkPaned::handle_size = 1
#GtkPaned::handle_width = 6
GtkRange::trough_border =0
GtkRange::slider_width =14
GtkRange::stepper_size =14
#GtkRange::trough-border = 0
#GtkRange::arrow-displacement-x = 0
#GtkRange::arrow-displacement-y = 0
#GtkRange::stepper-spacing = 0
#GtkRange::trough-side-details = 0
#GtkRange::trough-under-steppers = 0
#GtkScrollbar::fixed-slider-length = 1
GtkScrollbar::min_slider_length = 30
#GtkScrollbar::slider_width = 16
#GtkScrollbar::stepper_size = 24
#GtkScrollbar::activate-slider = 0
#GtkScrollbar::has-backward-stepper = 1
#GtkScrollbar::has-forward-stepper = 1
#GtkScrollbar::has-secondary-backward-stepper = 0
#GtkScrollbar::has-secondary-forward-stepper = 0
GtkCheckButton::indicator_size = 16
#GtkCheckButton::indicator_spacing = 3
#GtkCheckButton::focus-padding = 1
#GtkCheckMenuItem::indicator-size =17
GtkRadioButton::indicator_size = 16
#GtkRadioButton::focus-padding = 1
GtkMenuBar::shadow-type = GTK_SHADOW_NONE
GtkMenuBar::internal-padding = 4
#GtkMenuBar::button-relief = GTK_RELIEF_NONE
GtkMenu::horizontal-padding = 2
GtkMenu::vertical-padding = 2
#GtkMenu::horizontal-offset = 0
#GtkMenu::vertical-offset = 0
#GtkMenu::double-arrows = TRUE
#GtkMenuItem::arrow-scaling = 0
#GtkMenuItem::arrow-spacing = 0
#GtkMenuItem::horizontal-padding = 2
#GtkMenuItem::toggle-spacing = 3
#GtkMenuItem::selected-shadow-type = GTK_SHADOW_NONE
#GtkMenuItem::wide-separators = 1
#GtkMenuItem::separator-width = 1
#GtkMenuItem::separator-height = 1
GtkExpander::expander-size = 12
GtkExpander::expander-spacing = 2
GtkProgressBar::max-horizontal-bar-height = 15
GtkProgressBar::min-horizontal-bar-height = 15
#GtkProgressBar::min-vertical-bar-width = 10
#GtkProgressBar::xspacing = 2
#GtkProgressBar::yspacing = 10
#GtkProgressBar::trough_border = 2
#GtkStatusbar::shadow_type = GTK_SHADOW_NONE
#GtkSpinButton::shadow_type = GTK_SHADOW_NONE
#GtkSpinButton::inner-border = {0, 0, 0, 0}
#GtkSpinButton::focus-padding = 1
GtkToolButton::icon-spacing = 0
GtkToolbar::internal-padding = 2
GtkToolbar::shadow-type = GTK_SHADOW_NONE
#GtkToolbar::button-relief = GTK_RELIEF_NORMAL
#GtkToolbar::space-size = 2
#GtkToolbar::max-child-expand = 0
#GtkToolbar::space-style = GTK_TOOLBAR_SPACE_LINE
GtkDialog::action-area-border = 2
GtkDialog::button-spacing = 3
GtkDialog::content-area-border = 1
GtkOptionMenu::indicator_size = { 15, 8 }
GtkOptionMenu::indicator_spacing = { 8, 2, 0, 0 }
#GtkOptionMenu::focus-padding = 1
GtkStatusbar::shadow_type = GTK_SHADOW_NONE
GtkSpinButton::shadow_type = GTK_SHADOW_NONE
#GtkSpinButton::focus-padding = 1
#GtkScrolledWindow::scrollbar-spacing = 3
#GtkScrolledWindow::scrollbars-within-bevel = 1
#GtkScrolledWindow::shadow_type = GTK_SHADOW_NONE
GtkTreeView::row_ending_details = 0
GtkTreeView ::odd_row_color = "#d4d4d4"
GtkTreeView ::even_row_color = "#d8d8d8"
GtkTreeView::expander-size = 12
GtkTreeView::vertical-separator = 1
GtkTreeView::horizontal-separator = 4
GtkTreeView::allow-rules = 1
#GtkTreeView::indent-expanders = 1
#GtkTreeView::row-ending-details = 1
GtkHTML::cite_color = "#8e8e8e"
GtkWidget::link-color = "#0066ff"
GtkWidget::visited-link-color = "#0f3a7b"
GtkWidget::cursor-aspect-ratio = 0.05
GtkWidget::focus-line-width = 0
#GtkWidget::scroll-arrow-hlength = 16
#GtkWidget::scroll-arrow-vlength = 16
#GtkWidget::separator-height = 0
#GtkWidget::separator-width = 0
#GtkWidget::wide-separators = 0
#BonoboUiToolbar::shadow-type = GTK_SHADOW_NONE
WnckTasklist::fade-overlay-rect = 0
WnckTasklist::fade-loop-time = 5.0
#WnckTasklist::fade-max-loop = 50
WnckTasklist::fade-opacity = 0.5
NautilusIconContainer::highlight_alpha = 145
# The following line hints to gecko (and possibly other appliations)
# that the entry should be drawn transparently on the canvas.
# Without this, gecko will fill in the background of the entry.
GtkEntry::honors-transparent-bg-hint = 1
#GtkEntry::inner-border = {1, 1, 1, 1}
xthickness = 2
ythickness = 2
fg[NORMAL] = "#aaaaaa"
fg[PRELIGHT] = "#cccccc"
fg[SELECTED] = "#cccccc"
fg[ACTIVE] = "#bbbbbb"
fg[INSENSITIVE] = "#777777"
bg[NORMAL] = "#2d2d2d"
bg[PRELIGHT] = "#2d2d2d"
bg[SELECTED] = "#454545"
bg[ACTIVE] = "#2d2d2d"
bg[INSENSITIVE] = "#2d2d2d"
# bg_pixmap[NORMAL] = "Others/bg.png"
base[NORMAL] = "#d8d8d8"
base[PRELIGHT] = "#d8d8d8"
base[SELECTED] = "#777777"
base[ACTIVE] = "#d8d8d8"
base[INSENSITIVE] = "#d8d8d8"
text[NORMAL] = "#000000"
text[PRELIGHT] = "#000000"
text[SELECTED] = "#000000"
text[ACTIVE] = "#000000"
text[INSENSITIVE] = "#222222"
engine "pixmap"
{
image
{
function = HANDLE
recolorable = TRUE
overlay_file = "Handles/handle-h.png"
overlay_stretch = FALSE
orientation = HORIZONTAL
}
image
{
function = HANDLE
recolorable = TRUE
overlay_file = "Handles/handle-v.png"
overlay_stretch = FALSE
orientation = VERTICAL
}
####################### SHADOWS ############################x
image
{
function = SHADOW
shadow = IN
recolorable = FALSE
file = "Shadows/shadow-in.png"
border = { 4, 4, 4, 4 }
stretch = TRUE
}
image
{
function = SHADOW
shadow = OUT
recolorable = TRUE
file = "Shadows/shadow-out.png"
stretch = TRUE
}
image
{
function = SHADOW
shadow = ETCHED_IN
recolorable = TRUE
file = "Shadows/shadow-in.png"
border = { 4, 4, 4, 4 }
stretch = TRUE
}
image
{
function = SHADOW
shadow = ETCHED_OUT
recolorable = TRUE
file = "Shadows/shadow-etched-out.png"
border = { 4, 4, 4, 4 }
stretch = TRUE
}
image
{
function = SHADOW_GAP
recolorable = TRUE
file = "Frame-Gap/frame1.png"
border = { 2, 2, 2, 2 }
stretch = TRUE
gap_start_file = "Frame-Gap/frame-gap-start.png"
gap_start_border = { 2, 0, 2, 0 }
gap_end_file = "Frame-Gap/frame-gap-end.png"
gap_end_border = { 0, 2, 2, 0 }
gap_side = TOP
}
image
{
function = VLINE
recolorable = TRUE
file = "Lines/line-v.png"
border = { 0, 0, 0, 0 }
stretch = TRUE
}
image
{
function = HLINE
recolorable = TRUE
file = "Lines/line-h.png"
border = { 0, 0, 0, 0 }
stretch = TRUE
}
# focus
image
{
function = FOCUS
recolorable = TRUE
file = "Others/focus.png"
border = { 6, 0, 6, 0 }
stretch = TRUE
}
# Arrows (all states)
image
{
function = ARROW
recolorable = TRUE
state = NORMAL
overlay_file = "Arrows/arrow-up.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = UP
}
image
{
function = ARROW
state = PRELIGHT
recolorable = TRUE
overlay_file = "Arrows/arrow-up-prelight.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = UP
}
image
{
function = ARROW
state = ACTIVE
recolorable = TRUE
overlay_file = "Arrows/arrow-up-active.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = UP
}
image
{
function = ARROW
state = INSENSITIVE
recolorable = TRUE
overlay_file = "Arrows/arrow-up-insensitive.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = UP
}
image
{
function = ARROW
state = NORMAL
recolorable = TRUE
overlay_file = "Arrows/arrow-down.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = DOWN
}
image
{
function = ARROW
state = PRELIGHT
recolorable = TRUE
overlay_file = "Arrows/arrow-down-prelight.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = DOWN
}
image
{
function = ARROW
state = ACTIVE
recolorable = TRUE
overlay_file = "Arrows/arrow-down-pressed.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = DOWN
}
image
{
function = ARROW
state = INSENSITIVE
recolorable = TRUE
overlay_file = "Arrows/arrow-down-insens.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = DOWN
}
image
{
function = ARROW
recolorable = TRUE
state = NORMAL
overlay_file = "Arrows/arrow-left.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = LEFT
}
image
{
function = ARROW
recolorable = TRUE
state = PRELIGHT
overlay_file = "Arrows/arrow-left-prelight.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = LEFT
}
image
{
function = ARROW
recolorable = TRUE
state = ACTIVE
overlay_file = "Arrows/arrow-left-active.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = LEFT
}
image
{
function = ARROW
recolorable = TRUE
state = INSENSITIVE
overlay_file = "Arrows/arrow-left-insensitive.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = LEFT
}
image
{
function = ARROW
recolorable = TRUE
state = NORMAL
overlay_file = "Arrows/arrow-right.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = RIGHT
}
image
{
function = ARROW
recolorable = TRUE
state = PRELIGHT
overlay_file = "Arrows/arrow-right-prelight.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = RIGHT
}
image
{
function = ARROW
recolorable = TRUE
state = ACTIVE
overlay_file = "Arrows/arrow-right-active.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = RIGHT
}
image
{
function = ARROW
recolorable = TRUE
state = INSENSITIVE
overlay_file = "Arrows/arrow-right-insensitive.png"
overlay_border = { 0, 0, 0, 0 }
overlay_stretch = FALSE
arrow_direction = RIGHT
}
}
}
class "GtkWidget" style "default"
include"styles/tooltips"
include "styles/oo"
include"styles/button"
include"styles/entry"
include "styles/inactivetext"
include"styles/toolbar"
include"styles/optionmenu"
include"styles/handlebox"
include"styles/menu-menubar"
include"styles/panel"
include"styles/notebook"
include"styles/listheader"
include"styles/spin"
include"styles/scrollbar"
include"styles/statusbar"
include"styles/progressbar"
include"styles/range"
include"styles/checkbutton"
include"styles/radiobutton"
include"styles/combo"
include "styles/murrine-style-images-and-labels"
include "styles/inactivetext"
#include"Icons/iconrc"
最佳答案
好的 - 它有效。
引用文献1:https://wiki.gnome.org/GnomeArt/Tutorials/GtkEngines/PixmapEngine
引用文献2:https://wiki.gnome.org/GnomeArt/Tutorials/GtkThemes/GtkScrollbar
引用文献4:http://zetcode.com/tutorials/gtktutorial/customwidget/
我在这里使用了引用文献1:
import sys,os
import pygtk, gtk, gobject
class GTK_Main:
def __init__(self):
""" Design!!! """
button_rc = """
pixmap_path "/var/tmp"
style "default-style" {
GtkVScale::slider_length = 14
GtkVScale::slider_width = 15
GtkVScale::focus-padding = 4
GtkVScale::trough-side-details = 0
GtkVScale::trough-border = 1
GtkVScale::value-spacing = 0
GtkVScale::trough-under-steppers = 0
GtkVScale::arrow-displacement-x = 7
GtkVScale::arrow-displacement-y = 0
GtkVScale::activate_slider = 0
xthickness = 1
ythickness = 1
#bg[NORMAL] = "#f6f6f6"
fg[NORMAL] = "#000000"
}
class "GtkWidget" style "default-style"
style "deButton" {
fg[PRELIGHT] = { 0, 1.0, 1.0 }
bg[PRELIGHT] = { 0, 0, 1.0 }
bg[ACTIVE] = { 1.0, 0, 0 }
fg[ACTIVE] = { 0, 1.0, 0 }
bg[NORMAL] = { 1.0, 1.0, 0 }
fg[NORMAL] = { .99, 0, .99 }
bg[INSENSITIVE] = { 1.0, 1.0, 1.0 }
fg[INSENSITIVE] = { 1.0, 0, 1.0 }
engine "pixmap" {
image {
function = SLIDER
orientation = VERTICAL
file = "a.png"
stretch = TRUE
}
image {
function = BOX
orientation = VERTICAL
file = "b.gif"
border = { 0, 0, 32, 32}
stretch = TRUE
}
}
bg_pixmap[NORMAL] = "b.gif"
}
widget "*.deButton" style "deButton"
"""
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("Test")
window.set_default_size(500, 400)
window.connect("destroy", gtk.main_quit, "WM destroy")
gtk.rc_parse_string(button_rc) # 2
hbox_eq = gtk.HBox()
hbox_eq.set_size_request(200, 150)
self.hscale_one = gtk.VScale()# gtk.HScale()
self.hscale_one.set_range(-24, 12)
self.hscale_one.set_name("deButton") # 3
hbox_eq.pack_start(self.hscale_one, True, True, 0)
self.hscale_two = gtk.VScale()# gtk.HScale()
self.hscale_two.set_range(-24, 12)
hbox_eq.pack_start(self.hscale_two, True, True, 0)
vbox = gtk.VBox()
vbox.pack_start(hbox_eq, False)
window.add(vbox)
window.show_all()
def exit(self, widget, data=None):
gtk.main_quit()
GTK_Main()
gtk.gdk.threads_init()
gtk.main()
关于Python - 如何更改此 gtk.VScale 的图标和背景图像,使其看起来像预期的界面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19485656/
我从来没有遇到过这种问题 - 我也不知道为什么.. 有些图标丢失并以“?/!”闪烁显示 发生了什么事? 它是一个提交按钮。我在另一个按钮中有相同的图标 - 那里没问题。 SIGN! 有什
我只需要在单击按钮时显示 ionic 图标。 我试着在那个图标上放一个类并做到了: .icn { visibility: visible; } 但是没有用,有没有人知道另一种方法? 最佳答案 Sho
我用qt在托盘里做了一个应用。在我的电脑上,这是一个很好的项目,我在托盘栏中看到了图标,但是当我将其发布给其他人时,他们看不到该图标,它只是一个可以使用但不显示图标的隐形方 block 。但在我的电脑
我想使用delphi将图标/ bmp绘制到TListView的子项中。但是我不知道该怎么做到。它适用于列表中的第一项,但子项存在问题。 最佳答案 您可以使用CustomDrawSubItem事件。 下
我想将标题栏中的图标设置为应用程序的图标 [[myWindow standardWindowButton:NSWindowDocumentIconButton] setImage:[NSApp app
可以设置一个图标,以便在当前应用程序的每个窗口上使用它。这样我就设置了一次(不是手动在每个窗口上设置)..? 最佳答案 关于这个主题的一个很好的引用在这里 MSDN 。表明您有一个应用程序图标(桌面图
我为自己制作了一个小书签,它的功能很好,但当添加到 Opera 或 Firefox 的工具栏时,它只是呈现浏览器的默认书签图标(分别是地球仪和星星)。我的网站有一个网站图标,窗口、选项卡甚至 [网站]
制表符中的responsiveCollapse 折叠展开功能的默认图标似乎未居中。是否有更改此图标的选项。也许是右下胡萝卜? 最佳答案 responsiveCollapse 格式化程序只是一个像所有其
上面是下拉列表,当单击列表时,其值将与图像一起显示在上面的字段(顺便说一句,这是一个按钮)中。我已经实现了显示文本,但似乎无法显示图像。这是我的标记如下... 广东 @foreach
我想将我们数据库中的电线杆和电缆导出到 Google 地球的 KML 文件中。 对于每个节点,我们都有一个极阵列,电缆始终连接到阵列中的下一个极。 制作简单路径的导出似乎很容易。但是这些路径只是显示一
我想将我们数据库中的电线杆和电缆导出到 Google 地球的 KML 文件中。 对于每个节点,我们都有一个极阵列,电缆始终连接到阵列中的下一个极。 制作简单路径的导出似乎很容易。但是这些路径只是显示一
在 JTable 中显示数据。一列用作字段复选框。问题是在显示ChceckBox 中而不是出现图标true/false。我该如何解决这个问题? 添加数据: private DefaultTableMo
[编辑] 我想使用 DataTable 在 Datagridview 中使用图像。 RadioButton 只是这篇文章的一种简单问题格式。 让我为此澄清一下。 如何使用绑定(bind)样式在 dat
我正在使用 C# 开发 win 表单应用程序。我遇到了一个需要向用户提供 ComboBox 的场景。现在,为了使外观更具吸引力,我想在该组合框的每个项目之前显示一个小图像或图标。 我查看了一些提供此功
我正在 CrossRider 中构建一个扩展。我需要在数据库中保存我有它们的 url 的图像/图标。它们是微小的图像,不会成为数据库中的问题。我可能有类似的东西可以访问 background.js:
我需要使用我的 JavaFX 应用程序中的一些元素,这些元素使用 带有自定义符号/图标的按钮 横幅或背景图像。 此应用程序应该在具有不同屏幕分辨率的多个设备上运行,并且我还(最终)需要缩放图像/图标(
我怎样才能在 android studio 中做这样的事情: 我想要一个导航栏,您可以在其中看到名称、图标以及打开抽屉导航的机会 :D (图片是用Figma制作的) 最佳答案 将重力设置为在 Draw
当我在 ViewPager 中滑动 fragment 时,如何动态更改 Action Bar 的操作按钮图标。取决于 fragment 按钮必须改变状态(图标)。 最佳答案 您可以在 onPrepar
我有两个 while 循环,一个是循环遍历聊天日志以检索日期、用户名、消息,另一个 while 循环 是从单独的表中检索图标这有两列 chars 和 image (image-name.*) 我可以显
我正在尝试重新启动 mysql(一个完全不同的问题),MySql 肯定已安装(版本 14.14),并且根据我收集的信息,我应该在系统偏好设置面板的底部看到它的图标,但它是不在那里。安装过程中是否出现了
我是一名优秀的程序员,十分优秀!