#!/usr/bin/python3 import _thread as thread import time import copy from collections import OrderedDict import tkinter tk = tkinter from idlelib.tooltip import Hovertip #import tkgui.dialog as dialoglib #dialog = dialoglib.Dialog() import __main__ as MAIN from lib.cprint import * import lib.mytklib as mytklib #import lib.fixlib as fixlib #import lib.showlib as showlib #import lib.libtk as libtk #import lib.tkevent as tkevent class BEvent(): def __init__(self,data,cb): self._data = data self._cb = cb def cb(self,event): #print(self,event) self._cb(event,self._data) class GUI_menu(): def __init__(self,root,frame ,data,title="tilte"): global tk global INIT_OK self.frame = frame self.data = data self.elem = {} self.root = root self.draw() def draw(self): cprint("***",self,"draw") r=0 c=0 i=1 self.b = tk.Label(self.frame,bg="lightblue", text="MAIN:MENU",width=8,height=1) self.TITLE = self.b self.b.grid(row=r, column=c, sticky=tk.W+tk.E)#,anchor="w") BUF = [] for j in range(3): BUF.append([""]*40) print(BUF) r=0 h = 2 for row in self.data: print(" draw",row) text="" frame = self.frame #row = data[i] if row["text"] == "---": h=1 if "name" in row: text = row["name"] else: text = row["text"] if "- DEMO -" == text: c=2 r=1 b = tk.Button(frame,bg="lightgrey", text=text,width=8,height=h) self.b = b if "tip" in row: from idlelib.tooltip import Hovertip myTip = Hovertip(self.b,row["tip"]) self.b.bind("