Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ANNOUNCE] new alpha Tk::MDI (Multiple Document Interface)

0 views
Skip to first unread message

Ilya Zakharevich

unread,
Sep 28, 2001, 9:24:34 AM9/28/01
to
[A complimentary Cc of this posting was sent to
Ala Qumsieh
<aqum...@hyperchip.com>], who wrote in article <9ovudt$b...@fidoii.CC.Lehigh.EDU>:
> Attached is an alpha version of an MDI (Multiple Document Interface) widget
> that I'm working on. Please feel free to run the mdi.pl script and snoop
> around the source code. Admittedly, it's a brute force approach, but I
> couldn't find any better way to do it!
>
> For the moment, it's not a Tk widget. Rather, it's a simple object, but the
> only real difference for the programmers is how to instantiate the MDI
> widget. It should be easy to wrap it into a Tk widget, but that has to wait
> until I'm done with the basic functionality. Look at the mdi.pl script for
> an example.

Why people in some situations prefer an MDI layout? I spied after
myself, and the only reason I see is: a group-like z-order behaviour.
So implementing "a group-like z-order behaviour of multiple toplevels"
may be a good substitute for MDI. [I never minimize windows, so other
people may want a group-like minimize/restore too - but this should be
already available with wm::group.]

So the only thing to get MDI-done-with-toplevels is the reaction to
change-z-order requests. I think the following scenario may be a good
start:

AIM: the toplevels in a group are *always* adjacent in z-order;

HOW: if a 'raise'/'lower' request would move one window of a group
"away" from the group, move the rest of the group in the same
direction.

The only drawback is the case when a system-modal dialogue is shown,
and it is included in a group. Since it needs to be shown on top, the
whole group moves to the top. But maybe it is a correct thing to do?

Ilya

Ron Hartikka

unread,
Sep 28, 2001, 10:26:40 AM9/28/01
to
Great!

Suggestion for to do list: prevent user from dragging out of sight.

Example with Window menu, New command:

use Tk;
my $main = new MainWindow;
$menubar = $main->Frame(-relief=>"raised",
-borderwidth=>2);
$filebutton = $menubar->Menubutton(-text=>"File",
-underline => 0); # F in File
$filemenu = $filebutton->Menu();
$filebutton->configure(-menu=>$filemenu);
$filemenu->command(-command => \&open_choice,
-label => "Open...",
-underline => 0); # O in Open
$filemenu->separator;
$filemenu->command(-label => "Exit",
-command => \&exit_choice,
-underline => 1); # "x" in Exit
window_menu();
$helpbutton = $menubar->Menubutton(-text=>"Help",
-underline => 0); # H in Help
$helpmenu = $helpbutton->Menu();
$helpmenu->command(-command => \&about_choice,
-label => "About TkMenu...",
-underline => 0); # A in About
$helpbutton->configure(-menu=>$helpmenu);
$filebutton->pack(-side=>"left");
$Windowbutton->pack(-side=>"left");
$helpbutton->pack(-side=>"right");
$menubar->pack(-side=>"top", -fill=>"x");
$label = $main->Label(-text => "Main Area");
$status = $main->Label(-text=>"Status area",
-borderwidth=>2,
-anchor=>"w");
MDI();new_window();
MainLoop;
sub exit_choice {
print "You chose the Exit choice!\n";
exit;
}
sub open_choice {
# Fill in status area.
$status->configure(-text=>"Open file.");
print "Open file\n";
}
sub about_choice {
# Fill in status area.
$status->configure(-text=>"About program.");
print "About tkmenu.pl\n";
}
sub MDI{
use Tk::MDI;
$mdi = new Tk::MDI(-mw => $main,
-pack => [qw/-side top -expand 1 -fill both/],
);

}
sub window_menu{
$Windowbutton = $menubar->Menubutton(-text=>"Window",
-underline => 0); # F in Window
$Windowmenu = $Windowbutton->Menu();
$Windowbutton->configure(-menu=>$Windowmenu);
$Windowmenu->command(-command => \&new_window,
-label => "New",
-underline => 0); # N in New
}
sub new_window{
$window[$i] = $mdi->newWindow(-titlebg => 'red',
-titletext => "wnd".$i++,
);

}

> -----Original Message-----
> From: owne...@lists.Stanford.EDU
> [mailto:owne...@lists.Stanford.EDU]On Behalf Of Ala Qumsieh
> Sent: Thursday, September 27, 2001 2:06 PM
> To: ptk@lists. Stanford. EDU (E-mail)
> Subject: [ANNOUNCE] new alpha Tk::MDI (Multiple Document Interface)
>
>
>
> All,


>
> Attached is an alpha version of an MDI (Multiple Document
> Interface) widget
> that I'm working on. Please feel free to run the mdi.pl script and snoop
> around the source code. Admittedly, it's a brute force approach, but I
> couldn't find any better way to do it!
>
> For the moment, it's not a Tk widget. Rather, it's a simple
> object, but the
> only real difference for the programmers is how to instantiate the MDI
> widget. It should be easy to wrap it into a Tk widget, but that
> has to wait
> until I'm done with the basic functionality. Look at the mdi.pl script for
> an example.
>

> Windows are simply Frames with some decorations to make them look like
> windows. So, you can populate your windows as if they were frames (because
> they ARE frames). Functionality thus far includes moving windows,
> minimizing, maximizing, shading, unshading and killing. More
> stuff will come
> as I have the time to implement it.
>
> Please let me know what you think, and whether you have any code
> improvements/patches/ideas/flames.
>
> Enjoy :-)
> --Ala
>
>


-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majo...@lists.stanford.edu

RobS...@aol.com

unread,
Sep 28, 2001, 3:47:01 PM9/28/01
to

--part1_137.2440958.28e618d9_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

In a message dated 9/28/2001 10:02:40 AM Eastern Daylight Time,
ro...@iainc.com writes:


> Suggestion for to do list: prevent user from dragging out of sight.
>

I would suggest packing the child windows into a Scrollable pane
so that dragging off screen would be a problem. Simply scroll to wherever
the dragged item happens to go.

Rob

--part1_137.2440958.28e618d9_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

<HTML><FONT FACE=arial,helvetica><FONT SIZE=2>In a message dated 9/28/2001 10:02:40 AM Eastern Daylight Time, ro...@iainc.com writes:
<BR>
<BR>
<BR><BLOCKQUOTE TYPE=CITE style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">Suggestion for to do list: prevent user from dragging out of sight.
<BR></BLOCKQUOTE>
<BR>I would suggest packing the child windows into a Scrollable pane
<BR>so that dragging off screen would be a problem. Simply scroll to wherever
<BR>the dragged item happens to go.
<BR>
<BR>Rob</FONT></HTML>

--part1_137.2440958.28e618d9_boundary--

Ron Hartikka

unread,
Oct 1, 2001, 10:19:09 AM10/1/01
to
This is a multi-part message in MIME format.

------=_NextPart_000_0015_01C14A54.DDF82520
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

When you say, "Simply scroll to wherever the dragged item happens to go",
are you talking to the ultimate user of the program written with your
module. Or, are you talking to the programmer, the user of your module?

-----Original Message-----
From: owne...@lists.Stanford.EDU [mailto:owne...@lists.Stanford.EDU]On

Behalf Of RobS...@aol.com
Sent: Friday, September 28, 2001 2:18 PM
To: ro...@iainc.com
Cc: Ala Qumsieh; p...@lists.Stanford.EDU
Subject: Re: [ANNOUNCE] new alpha Tk::MDI (Multiple Document Interface)


In a message dated 9/28/2001 10:02:40 AM Eastern Daylight Time,
ro...@iainc.com writes:

Suggestion for to do list: prevent user from dragging out of sight.


I would suggest packing the child windows into a Scrollable pane
so that dragging off screen would be a problem.

Rob

------=_NextPart_000_0015_01C14A54.DDF82520
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dus-ascii" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3D"Courier New" size=3D2><SPAN =
class=3D420282212-01102001>When you=20
say, "Simply scroll to wherever the dragged item happens to =
go",&nbsp;are you=20
talking to the ultimate user of the program written with your module. =
Or, are=20
you talking to&nbsp;the programmer, the user of your module?=20
</SPAN></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2><SPAN=20
class=3D420282212-01102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2><SPAN=20
class=3D420282212-01102001><BR>&nbsp;</DIV></SPAN></FONT>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; PADDING-LEFT: =
5px">
<DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> =
owne...@lists.Stanford.EDU=20
[mailto:owne...@lists.Stanford.EDU]<B>On Behalf Of=20
</B>RobS...@aol.com<BR><B>Sent:</B> Friday, September 28, 2001 2:18=20
PM<BR><B>To:</B> ro...@iainc.com<BR><B>Cc:</B> Ala Qumsieh;=20
p...@lists.Stanford.EDU<BR><B>Subject:</B> Re: [ANNOUNCE] new alpha =
Tk::MDI=20
(Multiple Document Interface)<BR><BR></DIV></FONT><FONT=20
face=3Darial,helvetica><FONT size=3D2>In a message dated 9/28/2001 =
10:02:40 AM=20


Eastern Daylight Time, ro...@iainc.com writes: <BR><BR><BR>

<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; =
MARGIN-RIGHT: 0px; PADDING-LEFT: 5px"=20
TYPE=3D"CITE">Suggestion for to do list: prevent user from dragging =
out of=20
sight. <BR></BLOCKQUOTE><BR>I would suggest packing the child =
windows into a=20
Scrollable pane <BR>so that dragging off screen would be a problem.=20
<BR>Rob</FONT> </FONT></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0015_01C14A54.DDF82520--

0 new messages