python 图标背景会变化 如何找出图标_Python如何更改图标和背景图像gtk.V刻度所以它看起来像预期的接口?...

好的-它起作用了。在

18dc3e148fb6b9b20051d105ad92740a.png

我在这里使用了参考文献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()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值