Advertisement
gregwa

FCM143 - pandastabledemo_support.py

Mar 5th, 2019
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.64 KB | None | 0 0
  1. #! /usr/bin/env python
  2. #  -*- coding: utf-8 -*-
  3. #
  4. # Support module generated by PAGE version 4.21
  5. #  in conjunction with Tcl version 8.6
  6. #    Mar 05, 2019 04:45:41 AM CST  platform: Linux
  7.  
  8. import sys
  9. from pandastable import Table
  10.  
  11. try:
  12.     import Tkinter as tk
  13. except ImportError:
  14.     import tkinter as tk
  15.  
  16. try:
  17.     import ttk
  18.     py3 = False
  19. except ImportError:
  20.     import tkinter.ttk as ttk
  21.     py3 = True
  22.  
  23.  
  24. def on_btnExit():
  25.     print('pandastabledemo_support.on_btnExit')
  26.     sys.stdout.flush()
  27.     destroy_window()
  28.  
  29.  
  30. def init(top, gui, *args, **kwargs):
  31.     global w, top_level, root
  32.     w = gui
  33.     top_level = top
  34.     root = top
  35.     # Our init code starts here
  36.     csvfile = "BreadBasket.csv"
  37.     # Init the pandastable, setting the parent (w.frmCustomWidget) and
  38.     # set the showtoolbar and showstatusbar parameters to True
  39.     pt = Table(w.frameCustom, showtoolbar=True, showstatusbar=True)
  40.     # Show the table
  41.     pt.show()
  42.     # Import the CSV into the widget
  43.     pt.importCSV(csvfile)
  44.     # update the widget
  45.     pt.update()
  46.  
  47.  
  48. def destroy_window():
  49.     # Function which closes the window.
  50.     global top_level
  51.     top_level.destroy()
  52.     top_level = None
  53.  
  54.  
  55. # Replace the "generic" assignment for the custom control with the correct one
  56. # for our pandastable instance.
  57. # Custom = tk.Frame     # To be updated by user with name of custom widget.
  58. Custom = Table
  59.  
  60.  
  61. if __name__ == '__main__':
  62.     import pandastabledemo
  63.     pandastabledemo.vp_start_gui()
  64.  
  65. # ======================================================
  66. # End of pandastabledemo_support.py
  67. # ======================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement