{"id":3225,"date":"2024-04-16T10:44:17","date_gmt":"2024-04-16T15:44:17","guid":{"rendered":"http:\/\/www.ishygddt.xyz\/~blog\/?p=3225"},"modified":"2024-04-16T10:49:09","modified_gmt":"2024-04-16T15:49:09","slug":"tkinter-messagebox-ugly-on-linux","status":"publish","type":"post","link":"http:\/\/www.ishygddt.xyz\/~blog\/2024\/04\/tkinter-messagebox-ugly-on-linux","title":{"rendered":"tk.messagebox is ugly on Linux"},"content":{"rendered":"<p>Python's <a href=\"https:\/\/docs.python.org\/3\/library\/tkinter.messagebox.html\"><code class=\"lang-python\" data-line=\"\">tkinter.messagebox<\/code><\/a> module shows Windows native dialogs (<a href=\"https:\/\/github.com\/tcltk\/tk\/blob\/core-8-6-14\/win\/tkWinDialog.c#L2950\">win\/tkWinDialog.c#L2950<\/a>), and it shows Mac OS native dialogs (<a href=\"https:\/\/github.com\/tcltk\/tk\/blob\/core-8-6-14\/macosx\/tkMacOSXDialog.c#L1399\">macosx\/tkMacOSXDialog.c#L1399<\/a>), but since Linux doesn't <em>have<\/em> any clearly defined \"native\" dialog system, Tkinter uses a fallback messagebox built out of Tkinter widgets (<a href=\"https:\/\/github.com\/tcltk\/tk\/blob\/core-8-6-14\/library\/msgbox.tcl#L115\">library\/msgbox.tcl#L115<\/a>).<\/p>\n<p>However, Python does <em>not<\/em> currently have any non-ugly \"ttk\" bindings for this (<a href=\"https:\/\/github.com\/python\/cpython\/blob\/v3.12.3\/Lib\/tkinter\/messagebox.py#L61\">Lib\/tkinter\/messagebox.py#L61<\/a>).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python's tkinter.messagebox module shows Windows native dialogs (win\/tkWinDialog.c#L2950), and it shows Mac OS native dialogs (macosx\/tkMacOSXDialog.c#L1399), but since Linux doesn't have any clearly defined \"native\" dialog system, Tkinter uses a fallback messagebox built out of Tkinter widgets (library\/msgbox.tcl#L115). However, Python does not currently have any non-ugly \"ttk\" bindings for this (Lib\/tkinter\/messagebox.py#L61).<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[],"class_list":["post-3225","post","type-post","status-publish","format-standard","hentry","category-original-content"],"_links":{"self":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/3225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/comments?post=3225"}],"version-history":[{"count":5,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/3225\/revisions"}],"predecessor-version":[{"id":3231,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/posts\/3225\/revisions\/3231"}],"wp:attachment":[{"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/media?parent=3225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/categories?post=3225"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ishygddt.xyz\/~blog\/wp-json\/wp\/v2\/tags?post=3225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}