Code Comments
Programming Forum and web based access to our favorite programming groups.Ala, Jack, I have been trying out Tk::MDI. It works very well. But I have the following suggestions/wishlist: 1) Allow initial opening of a child in a specified state, such as maximized. 2) Advertise functions to focus/raise a child window. 3) Create functions to determine which child has the focus. 4) Allow callbacks when child focus has changed. 5) Allow the menubar widget to be specified. ...or if you have suggestions to accomplish these .... Anyways, in the meantime, I will try to figure out workarounds. I know that you have been updating the module. Any ideas what the ETA is? thx, Chris
Post Follow-up to this messageChris Whiting wrote: [snip] Thanks. That list will go into Tk::MDI's (rather long) TODO list. > Anyways, in the meantime, I will try to figure out workarounds. I know th at > you have been updating the module. Any ideas what the ETA is? Neither Jack nor I have been working on this lately. I can't really give you an ETA since we don't have one. Every now and then I open up the code and tweak something here and there (and sometimes break other things in the process), but there is still a lot to be done. Btw, patches are welcome :) --Ala
Post Follow-up to this messageAla, I can probably (try to) help some. I am wondering though if I should use a more current working version. If the data stricture has not changed, and if the suggested wishlist items have not previously been started, then I could just use the current version. Is these any info on the widgets data structure available? thx, Chris "Ala Qumsieh" <notvalid@email.com> wrote in message news:FgAnd.19993$zx1.5006@newssvr13.news.prodigy.com... > Chris Whiting wrote: > > [snip] > > Thanks. That list will go into Tk::MDI's (rather long) TODO list. > that > > Neither Jack nor I have been working on this lately. I can't really give > you an ETA since we don't have one. Every now and then I open up the > code and tweak something here and there (and sometimes break other > things in the process), but there is still a lot to be done. > > Btw, patches are welcome :) > > --Ala > >
Post Follow-up to this messageHere are some workarounds to my wishlist which seem to work reasonably well.
I am still testing but they look ok.
1) Allow initial opening of a child in a specified state, such as maximized.
After adding the child window such as:
$mdi->add(-titletext=>$filename,);
then maximize it with:
$mdi->{WINS}{$mdi->{FOCUSED}}->Tk::MDI::ChildWindow::_maximizeWindow;
2) Advertise functions to focus/raise a child window.
this workaround function searches for the window to focus, then focuses it.
It also maximizes the window if the previous focused window had focus. This
workaround requires unique child window names.
sub focus_window {
my $ismax = $mdi->{WINS}{$mdi->{FOCUSED}}->{ISMAX};
foreach my $def ( keys %{$mdi->{WINS}} ) {
if ($def =~ /$filename/) {
$mdi->{WINS}{$def}->Tk::MDI::ChildWindow::_focusIt;
if ($ismax) { print "MAXIMIZING $open_filename\n" ;
$mdi->{WINS}{$def}->Tk::MDI::ChildWindow::_maximizeWindow;}
}
}
}
3) Create functions to determine which child has the focus.
I found this in a previous post:
my $focused = $mdi->{WINS}{$mdi->{FOCUSED}}->mainFrame;
4) Allow callbacks when child focus has changed.
I simply put a bind on the child window. Its not perfect. I am going to
try to bind specific MDI subwidgets to match the conditions of 'click',
'strict', and 'lazy'.
5) Allow the menubar widget to be specified.
Not really needed.
6) [new] Create a callback for child window closures:
$mdi_child{$filename}->bind('<Destroy>', sub {
print "DESTROYED $filename\n";
},
);
Chris
"Ala Qumsieh" <notvalid@email.com> wrote in message
news:FgAnd.19993$zx1.5006@newssvr13.news.prodigy.com...
> Chris Whiting wrote:
>
> [snip]
>
> Thanks. That list will go into Tk::MDI's (rather long) TODO list.
>
that
>
> Neither Jack nor I have been working on this lately. I can't really give
> you an ETA since we don't have one. Every now and then I open up the
> code and tweak something here and there (and sometimes break other
> things in the process), but there is still a lot to be done.
>
> Btw, patches are welcome :)
>
> --Ala
>
>
Post Follow-up to this messageI have a ton of emails asking for upgrades to Tk::MDI. I also "had" (note
the tense) code suggestions sent to me over a year ago. I had these stored
in a zipped format and our MS Outlook upgrade at work antigened them - gone
forever. When I discovered this I immediately put together all my e-mails
and saved them. I will go through them to improve upon the wish list. We
need to get this all in one place...This code is on Sourceforge.
Do you have an account? If so - then Ala can add your name to the admin
list. If not - get one and let us know your ID.
This way we can add to the wish list and all start with the same code base.
Jack
"Chris Whiting" <chrisremovethis@andthisriverslime.om> wrote in message
news:41a0c6a3$1_3@alt.athenanews.com...
> Here are some workarounds to my wishlist which seem to work reasonably
well.
> I am still testing but they look ok.
>
> 1) Allow initial opening of a child in a specified state, such as
maximized.
>
> After adding the child window such as:
>
> $mdi->add(-titletext=>$filename,);
>
> then maximize it with:
>
> $mdi->{WINS}{$mdi->{FOCUSED}}->Tk::MDI::ChildWindow::_maximizeWindow;
>
> 2) Advertise functions to focus/raise a child window.
>
> this workaround function searches for the window to focus, then focuses
it.
> It also maximizes the window if the previous focused window had focus.
This
> workaround requires unique child window names.
>
> sub focus_window {
>
> my $ismax = $mdi->{WINS}{$mdi->{FOCUSED}}->{ISMAX};
>
> foreach my $def ( keys %{$mdi->{WINS}} ) {
>
> if ($def =~ /$filename/) {
> $mdi->{WINS}{$def}->Tk::MDI::ChildWindow::_focusIt;
> if ($ismax) { print "MAXIMIZING $open_filename\n" ;
> $mdi->{WINS}{$def}->Tk::MDI::ChildWindow::_maximizeWindow;}
> }
> }
>
> }
>
> 3) Create functions to determine which child has the focus.
>
> I found this in a previous post:
>
> my $focused = $mdi->{WINS}{$mdi->{FOCUSED}}->mainFrame;
>
> 4) Allow callbacks when child focus has changed.
>
> I simply put a bind on the child window. Its not perfect. I am going to
> try to bind specific MDI subwidgets to match the conditions of 'click',
> 'strict', and 'lazy'.
>
> 5) Allow the menubar widget to be specified.
>
> Not really needed.
>
> 6) [new] Create a callback for child window closures:
>
> $mdi_child{$filename}->bind('<Destroy>', sub {
> print "DESTROYED $filename\n";
> },
> );
>
> Chris
>
> "Ala Qumsieh" <notvalid@email.com> wrote in message
> news:FgAnd.19993$zx1.5006@newssvr13.news.prodigy.com...
know
> that
>
>
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.