我一直在尝试在Kivy中创建一个简单的tic-tac-toe应用程序。我从布局UI开始,发现顶部隐藏在Windows标题栏下。我试图在Kivy文档,StackOverflow等中寻找答案,但没有运气。
以下是参考资料的屏幕截图:Titlebar covering up part of Kivy app
.kv文件
from kivy.uix.gridlayout import GridLayout
from kivy.app import App
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.properties import ListProperty
class GridEntry(Button):
coords = ListProperty([0, 0])
class TicTacToeGrid(GridLayout):
'''Kivy widget for the tic-tac-toe board'''
def __init__(self, *args, **kwargs):
super(TicTacToeGrid, self).__init__(*args, **kwargs)
for row in range(3):
for column in range(3):
grid_entry = GridEntry(
coords=(row, column))
grid_entry.bind(on_release=self.button_pressed)
self.add_widget(grid_entry)
def button_pressed(self, button):
'''Print output just to see what's going on'''
print('{} button clicked!'.format(button.coords))
class TicTacToeApp(App):
'''Tic-tac-toe app using Kivy'''
def build(self):
Window.clearcolor = (0.688, 0.664, 0.640, 1)
return self.root
if __name__ == "__main__":
TicTacToeApp().run()
.py文件
#include <bits/stdc++.h>
using namespace std;
class Example{
private:
int var1;
Example *oak;
};
非常感谢帮助。
答案 0 :(得分:1)
我最近在戴尔XPS 15上遇到了完全相同的问题。通过设备管理器更新集成图形处理器的驱动程序解决了我的设置,你试过吗?