Hi experts, I am not a full programmer. I kind of do it for my needs. My request could be easy to do with Perl-Tk but I have no clue how to...
I have a notebook with Sheets added inside a foreach loop. Inside each tab I have Text area that displays log using fileevent. Works really well.
The window is launched and $log_display->insert('end', $_ ); works great.
I want to 'add' more tabs to this notebook dynamically from another job start if a condition is met.
Since the widgets are created already, I was looking for a function like 'get all opened mainwindow' and for the new job, I thought I could add the new tab to the handle.
I want to update this mainwindow when I start the same pm file. My application request is not allowing me to 'add' using a button or so. I have to detect the previous window and add to it. hope I was clear! :-)My code skeleton looks like: my $window = Tk::MainWindow->new(); my $book = $window->NoteBook(); #geometry, pack, title etc @input=("corner1","corner2")#generated by another loop #other buttons frames etc foreach my $corner (@input) { $tab = $book->add("TAB $index", -label => "$corner"); $for_display=$tab->Scrolled('Text', )->pack(); #blah blah $CHILD = IO::Handle->new; open($CHILD, "$unix_command 2>&1 |"); $logWindow->fileevent($CHILD, 'readable', [\&callback,args]); } #then using sub callback will insert the $_ if sysread.
how to achieve this?
In reply to Perl-Tk Notebook - add a new tab to exisitng $mw by shankar.chandra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |