Hi guys how is possible in pyTLK create a tablewidget? i try in this mode but crash the application and not appear a table
from fltk import *
import sys
window = None
class MyTable(Fl_Table):
def __init__(self, x, y, w, h, title):
Fl_Table.__init__(self, x, y, w, h, title)
self.rows = 10
self.cols = 1
def draw_cell(self, context, row, col, x, y, w, h):
context.draw_text(x + 2, y, w - 4, h, f"Item {row + 1}", FL_ALIGN_LEFT)
def cell_callback(ptr, widget):
selected_item = table.callback_row()
print("Selected item:", selected_item)
def exitcb(ptr, widget):
sys.exit(0)
window = Fl_Window(10, 100, 1440, 250, "Terminal")
table = MyTable(10, 31, 480, 210, "Table")
table.callback(cell_callback)
b1 = Fl_Button(1345, 4, 80, 21, "&Connetti")
b1.callback(cell_callback, window)
window.end()
window.show()
Fl.run()
What I have tried:
i try to remove a class table and work