| 1 |
from fltk import * |
| 2 |
|
| 3 |
|
| 4 |
win=Fl_Window(300,200) |
| 5 |
win.begin() |
| 6 |
|
| 7 |
win.add(Fl_Input(100, 10, 100, 40,'child 0 .add')) |
| 8 |
inp=Fl_Input(100, 100, 100, 40,'child 1 inp') |
| 9 |
|
| 10 |
win.end() |
| 11 |
|
| 12 |
print(win.children()) |
| 13 |
print('parent win: ', type(win) , id(win)) |
| 14 |
|
| 15 |
print('child 0 .add: ', type(win.child(0)), id(win.child(0))) |
| 16 |
|
| 17 |
print('child 1 inp: ', type(win.child(1)), id(win.child(1))) |
| 18 |
print('Fl_Input inp: ', type(inp) , id(inp)) |
| 19 |
|
| 20 |
win.child(0).color(FL_YELLOW) |
| 21 |
win.child(1).color(FL_GREEN) |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
inp.value('Bye') |
| 26 |
|
| 27 |
print('notice the id of child 0 and child 1 are the same. This seems wrong.') |
| 28 |
win.show() |
| 29 |
Fl.run() |
| 30 |
|