我使用gWidgets和Rgtk2软件包。
我希望更改几个小部件的背景颜色。
对于gmenu的项目和gnotebook的标签,除了小部件gbutton之外,其他一切都正常(gwindow / gframe ...)。
我尝试了多个代码,但是颜色保持灰色(也许是系统的默认主题)。
def pdf():
def extract_information(pdf_path):
with open(pdf_path, 'rb') as f:
pdf = PdfFileReader(f)
information = pdf.getDocumentInfo()
number_of_pages = pdf.getNumPages()
txt = f"""
Information about {pdf_path}:
Author: {information.author}
Creator: {information.creator}
Producer: {information.producer}
Subject: {information.subject}
Title: {information.title}
Number of pages: {number_of_pages}
"""
print(txt)
return information
if __name__ == '__main__':
path = input("What is the name of the pdf?(be sure to add .pdf to the end of the name) ")
extract_information(path)
如果Rgtk2的功能无法实现,是否还有另一种方法可以通过代码R更改背景主题默认值的灰色?
谢谢