[R-gui] tcltk MDI

Peng Liu pliu3 at unity.ncsu.edu
Wed Jul 14 07:03:19 CEST 2004


On Wed, 14 Jul 2004, James Wettenhall wrote:

> Hi Peng,
>
> My understanding is that MDI is very difficult (or perhaps
> impossible) in Tcl/Tk.

Hi James,

I guess so. That is why I cannot find exciting Tk MDI examples, although
Tcl/Tk has been there for quite a while. Or UNIX users are not interested
in MDI.

>
> Here are some MDI Tcl/Tk ideas in a Wiki entry:
> http://wiki.tcl.tk/2163
>
> (I just found them by Googling Tcl/Tk MDI)

Yes, that might be only official place about Tk MDI. Actually, I tried the
example : "Internal Movable Windows". That reminds me of my Visual Baisc
experience long time ago. Since we do not have existing sub-windows
widgets, we may be able to draw them! I did that under Win3.1.
However, the major difficulty for me is how to attach a "move" event to a
widget, also a "resize" event, etc.
Forgive me for that, I am a newbie to Tk. I combine your examples of
Pull-Down Menus, Frames, plus a Label widget on toplevel(). Next I am
trying to figure out how to move frames within the Label. (Cannot do it
yet.)
Another solution I was thinking about is to use canvas to directly draw.
Not a good idea I think.

>
> Another thing Tcl/Tk is lacking is true modal dialogs.  It can

Can we also mimic dialogs, using canvas or similar tricks?

> simulate them with grab, but unfortunately, it is still
> possible for them to occasionally become hidden behind other
> windows.
>
> Is platform independence important to you?  If you only need

Actually, I focus on R GUI these days is to demonstrate its GUI capability
to other point-click users. They claim that R does NOT HAVE a GUI.
And, they do not think Tcl/Tk's dialog-style is a GUI. That is why I am
thinking about MDI.

> your software to run on Windows, perhaps one option is to use
> GraphApp (the GUI toolkit used to build the main Rgui windows).
> See the windlgs example in:
> rw1091\src\library\windlgs\
> Or you could even use Microsoft Visual C++ / Visual Basic
> and R DCOM.

GraphApp would be a good solution for me, since it is a C interface. But I
am still thinking about portability. Anyway, it cannot generate GUI via
script language, such as Tcl/Tk, wxPython, wxPerl. So I think, it will be
a lot of work to make a fully working GUI for even one library, for
example MASS.

>
> These limitations in Tcl/Tk are two of the main reasons why I
> have started looking at wxPython as an alternative to Tcl/Tk.
> Right now, I can't seem to access the wxPython and wxWidgets
> websites, but you should be able to find some screenshots
> there, including MDI:
> http://www.wxPython.org/screenshots.php

I will try your R-wxPython soon. The major concern is which is faster, R
-> rtcltk -> Tcl/Tk , or R -> RwxWindows -> RSPython -> wxPython, or it
does not matter?

>
> A good way of getting an overview of what Tcl/Tk has to offer,
> is to run the ActiveTcl demos.  I don't think there's any MDI
> there.  But Tcl/Tk does at least have tabbed notebooks.

I did not find any, either.

>
> I have started building an R interface to wxPython:
> http://bioinf.wehi.edu.au/folders/james/wxPython/
> (which works reasonably well on Windows)
>
> but I still haven't really had time to try MDI, as I'm still
> spending a lot of time maintaining and supporting my existing
> R-Tcl/Tk GUI applications, and I have found that porting
> R-wxPython from Windows to Linux is non-trivial for several
> reasons.  One reason is that unlike Windows, Red Hat Linux's
> Python RPM doesn't include a shared library (libpython2.2.so) !

So, your RwxPython do use Python directly for some functions, doesn't it?
Not pass everything through RSPython.
Anyway, do you want to try Mandrake's rpm? I think Mandrake rpm will work
on Red Hat. the file is libpython2.2-2.2-9.1mdk.i586.rpm
You can download it from rpmfind.net at:
http://rpmfind.net//linux/RPM/mandrake/updates/mnf8.2/RPMS/libpython2.2-2.2-9.1mdk.i586.html

Cheers,
Peng

>
> Best regards,
> James
>
>



More information about the R-SIG-GUI mailing list