@@ -31,8 +31,8 @@ class App:
3131 """the GUI graphic application"""
3232 def __init__ (self ):
3333 """create a tkk graphic interface with a main window tk_win"""
34- self .__version__ = '0.9.0 '
35- self ._title = "2019-04-02a : 'De-duplicate column names !'"
34+ self .__version__ = '0.9.1 '
35+ self ._title = "2019-06-16a : 'Support un-named Tabs !'"
3636 self .conn = None # Baresql database object
3737 self .database_file = ""
3838 self .tk_win = Tk ()
@@ -465,40 +465,38 @@ def btn_presstwice(self, event):
465465 """double-click on a tab definition to change label"""
466466 x , y , widget = event .x , event .y , event .widget
467467 elem = widget .identify (x , y )
468- if "label" in elem : # and widget.instate(['pressed']):
469- index = widget .index ("@%d,%d" % (x , y ))
470- titre = widget .tab (index , 'text' )
471- # determine selected table
472- actions = [widget , index ]
473- title = 'Changing Tab label'
474- fields = ['' , ['current label' , (titre ), 'r' , 30 ], '' ,
475- ['new label' , titre , 'w' , 30 ]]
476- create_dialog (title , fields , ("Ok" , self .btn_chg_tab_ok ), actions )
468+ index = widget .index ("@%d,%d" % (x , y ))
469+ titre = widget .tab (index , 'text' )
470+ # determine selected table
471+ actions = [widget , index ]
472+ title = 'Changing Tab label'
473+ fields = ['' , ['current label' , (titre ), 'r' , 30 ], '' ,
474+ ['new label' , titre , 'w' , 30 ]]
475+ create_dialog (title , fields , ("Ok" , self .btn_chg_tab_ok ), actions )
477476
478477 def btn_press (self , event ):
479- """button press over a widget with a 'close' element"""
480- x , y , widget = event .x , event .y , event .widget
481- elem = widget .identify (x , y ) # widget is the notebook
482- if "close" in elem : # close button function
483- index = widget .index ("@%d,%d" % (x , y ))
484- widget .state (['pressed' ])
485- widget .pressed_index = index
486- elif "label" in elem : # move function
487- index = widget .index ("@%d,%d" % (x , y ))
488- self .state_drag = True
489- self .state_drag_widgetid = widget .tabs ()[index ]
490- self .state_drag_index = index
478+ """button press over a widget with a 'close' element"""
479+ x , y , widget = event .x , event .y , event .widget
480+ elem = widget .identify (x , y ) # widget is the notebook
481+ if "close" in elem : # close button function
482+ index = widget .index ("@%d,%d" % (x , y ))
483+ widget .state (['pressed' ])
484+ widget .pressed_index = index
485+ else : # move function
486+ index = widget .index ("@%d,%d" % (x , y ))
487+ self .state_drag = True
488+ self .state_drag_widgetid = widget .tabs ()[index ]
489+ self .state_drag_index = index
491490
492491 def btn_Movex (self , event ):
493492 """make the tab follows if button is pressed and mouse moves"""
494493 x , y , widget = event .x , event .y , event .widget
495494 elem = widget .identify (x , y )
496- if "label" in elem : # and widget.instate(['pressed']):
497- index = widget .index ("@%d,%d" % (x , y ))
498- if self .state_drag :
499- if self .state_drag_index != index :
500- self .btn_Move (widget , self .state_drag_index , index )
501- self .state_drag_index = index
495+ index = widget .index ("@%d,%d" % (x , y ))
496+ if self .state_drag :
497+ if self .state_drag_index != index :
498+ self .btn_Move (widget , self .state_drag_index , index )
499+ self .state_drag_index = index
502500
503501 def btn_Move (self , notebook , old_index , new_index ):
504502 """Move old_index tab to new_index position"""
0 commit comments