This repository has been archived on 2023-09-06. You can view files and clone it, but cannot push or open issues/pull-requests.
yutent
/
py-gtk-notes
Archived
1
0
Fork 0
master
yutent 2023-08-01 19:34:31 +08:00
parent 5b0ec56c5b
commit 84e3628606
1 changed files with 12 additions and 3 deletions

15
main.py
View File

@ -82,8 +82,8 @@ class WebKitWindow(Gtk.Window):
im = self.webview.get_input_method_context()
im.set_enable_preedit(True)
# self.webview.load_uri("app:///index.html")
self.webview.load_uri("https://benchmark.wkit.fun")
self.webview.load_uri("app:///index.html")
# self.webview.load_uri("https://benchmark.wkit.fun")
# 解决输入法候选框跟随问题
@ -95,12 +95,21 @@ class WebKitWindow(Gtk.Window):
self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
# button = Gtk.Button()
# gset = Gtk.Settings.get_default()
# set_string_property, set_property_value
# gset.set_property('gtk-cursor-theme-name', 'Bibata-Modern-Classic')
self.add(self.webview)
# self.add(button)
def on_preedit_changed(self, im):
p = self.display.get_pointer() # 光标位置
seat = self.display.get_default_seat()
p = seat.get_pointer().get_position() # 光标位置
x, y = self.get_position() # 窗口位置
im.notify_focus_in()