aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2024-04-06 11:04:27 -0400
committerB. Stack <bgstack15@gmail.com>2024-04-06 11:04:27 -0400
commit22889e2c42bf33523b1ddff82d555ad144c56289 (patch)
tree29ad272f1ccd2f65a13f29c9f35a7d55936c0aa7
parenttk: minor code fixes, README: add screenshot (diff)
downloadsrb_lib-22889e2c42bf33523b1ddff82d555ad144c56289.tar.gz
srb_lib-22889e2c42bf33523b1ddff82d555ad144c56289.tar.bz2
srb_lib-22889e2c42bf33523b1ddff82d555ad144c56289.zip
tk: add tooltip for breakables
-rwxr-xr-xsrb_tk.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/srb_tk.py b/srb_tk.py
index 607daa8..7f64e87 100755
--- a/srb_tk.py
+++ b/srb_tk.py
@@ -155,14 +155,12 @@ class App(tk.Frame):
self.level_letters = []
statuses = [i["name"] for i in srb_lib.LEVEL_STATUSES]
statuses_hex = [i["b"] for i in srb_lib.LEVEL_STATUSES]
- self.level_breakables = []
for i in range(0,len(srb_lib.LEVELS)):
self.level_strs.append(tk.StringVar(value=srb_lib.get_level_info(i)[0]["name"]))
self.level_statuses_hex.append(tk.StringVar(value=statuses_hex[0]))
self.level_statuses.append(tk.StringVar(value=statuses[0]))
self.level_balloons.append(tk.IntVar())
self.level_letters.append(tk.IntVar())
- self.level_breakables.append(tk.IntVar())
# END DATA VARIABLES
# statusbar variable
@@ -277,6 +275,7 @@ class App(tk.Frame):
self.btn_letters_all = []
self.btn_levels_breakables = []
self.bim_levels_breakables = []
+ self.ttp_levels_breakables = []
self.img_balloons = []
self.img_breakables = []
self.BREAKABLES = sorted(srb_lib.BREAKABLES,key=lambda i: i["w"])
@@ -345,6 +344,7 @@ class App(tk.Frame):
# and now all of a sudden it does pixels.
self.btn_levels_breakables[-1].config(width=88,image=self.bim_levels_breakables[-1])
self.btn_levels_breakables[-1].grid(row=x,column=16)
+ self.ttp_levels_breakables.append(stk.Tooltip(self.btn_levels_breakables[-1]))
x += 1
# end for-j-in-levels
x += 1
@@ -747,6 +747,7 @@ class App(tk.Frame):
if self.bim_levels_breakables[y] != -1: # which really means, if IMAGES
self.btn_levels_breakables[y].config(image=self.bim_levels_breakables[y])
self.btn_levels_breakables[y].config(text=str(len(b_list)))
+ self.ttp_levels_breakables[y].text = b_str
# y counts number of levels with breakables
y = y + 1
# end of if-level-has-breakables
bgstack15