shankar.chandra has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl-Tk Notebook - add a new tab to exisitng $mw
by Anonymous Monk on Sep 10, 2016 at 08:04 UTC | |
by shankar.chandra (Initiate) on Sep 12, 2016 at 22:56 UTC | |
by Anonymous Monk on Sep 13, 2016 at 00:25 UTC | |
by shankar.chandra (Initiate) on Sep 20, 2016 at 16:32 UTC | |
by choroba (Cardinal) on Sep 20, 2016 at 17:07 UTC | |
by Anonymous Monk on Sep 20, 2016 at 18:13 UTC | |
| |
by Anonymous Monk on Sep 15, 2016 at 20:11 UTC | |
by Anonymous Monk on Sep 15, 2016 at 20:20 UTC |