R Tcl/Tk: How to put widgets in text widget?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

R Tcl/Tk: How to put widgets in text widget?

Christoph Lange
Dear all,

please excuse the somewhat special question:

>From within R I create a Tk windows with a list of checkboxes, which can
bekome too long for the screen. The obvious solution would be to put all
checkboxes into a frame and make that scrollable. Alas, there are (for
whatever reason!) no scrollable frames in Tk :-(

The usual workaround is to put widgets (my checkboxes) into a textbox,
which you _can_ make scrollable. In Tcl/Tk, when $t is a text widget, the
code would be as follows:


button $t.help -bitmap questhead -command Help
$t window create end -window $t.help

But what is the R equivalent? From the general naming scheme I would have
guessed something like 'tktext.window', but that doesn't exist. Any trick
with 'tkconfigure', perhaps?

Any help is urgently appreciated ;-)
(Which could also be a totally different workaround ...)

Cheers
Christoph

--
Dipl.-Biol. Christoph Lange
Saatmoorgraben 15
28879 Grasberg
http://geohash.org/u1qqkmpu6hzkc

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R Tcl/Tk: How to put widgets in text widget?

Milan Bouchet-Valat
Le lundi 21 janvier 2013 à 10:32 +0100, Christoph Lange a écrit :

> Dear all,
>
> please excuse the somewhat special question:
>
> >From within R I create a Tk windows with a list of checkboxes, which can
> bekome too long for the screen. The obvious solution would be to put all
> checkboxes into a frame and make that scrollable. Alas, there are (for
> whatever reason!) no scrollable frames in Tk :-(
>
> The usual workaround is to put widgets (my checkboxes) into a textbox,
> which you _can_ make scrollable. In Tcl/Tk, when $t is a text widget, the
> code would be as follows:
>
>
> button $t.help -bitmap questhead -command Help
> $t window create end -window $t.help
>
> But what is the R equivalent? From the general naming scheme I would have
> guessed something like 'tktext.window', but that doesn't exist. Any trick
> with 'tkconfigure', perhaps?
(Totally uninformed guess:) tkwindow.create() maybe? At least, that's be
how I would translate the code you posted above.

> Any help is urgently appreciated ;-)
> (Which could also be a totally different workaround ...)
>
> Cheers
> Christoph
>

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R Tcl/Tk: How to put widgets in text widget?

Christoph Lange
That was it. Thanks!


On Mon, Jan 21, 2013 at 11:21 AM, Milan Bouchet-Valat <[hidden email]>wrote:

> Le lundi 21 janvier 2013 à 10:32 +0100, Christoph Lange a écrit :
> > Dear all,
> >
> > please excuse the somewhat special question:
> >
> > >From within R I create a Tk windows with a list of checkboxes, which can
> > bekome too long for the screen. The obvious solution would be to put all
> > checkboxes into a frame and make that scrollable. Alas, there are (for
> > whatever reason!) no scrollable frames in Tk :-(
> >
> > The usual workaround is to put widgets (my checkboxes) into a textbox,
> > which you _can_ make scrollable. In Tcl/Tk, when $t is a text widget, the
> > code would be as follows:
> >
> >
> > button $t.help -bitmap questhead -command Help
> > $t window create end -window $t.help
> >
> > But what is the R equivalent? From the general naming scheme I would have
> > guessed something like 'tktext.window', but that doesn't exist. Any trick
> > with 'tkconfigure', perhaps?
> (Totally uninformed guess:) tkwindow.create() maybe? At least, that's be
> how I would translate the code you posted above.
>
> > Any help is urgently appreciated ;-)
> > (Which could also be a totally different workaround ...)
> >
> > Cheers
> > Christoph
> >
>
>

--
Dipl.-Biol. Christoph Lange
Saatmoorgraben 15
28879 Grasberg
http://geohash.org/u1qqkmpu6hzkc

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: R Tcl/Tk: How to put widgets in text widget?

jverzaniNWBKZ
This post has NOT been accepted by the mailing list yet.
In reply to this post by Christoph Lange
There is some code in the gWidgets2tctlk for doing this within a canvas object (https://github.com/jverzani/gWidgets2tcltk/blob/master/R/ggroup.R). As well the ex-tcltk-scrollable-frame.R file in the Examples directory of ProgGUIinR package.

Alternatively, you can just use gWidgets2tcltk and therein find the gcheckboxgroup widget. Passing  use.table=TRUE will show a hacked version of this using a table with the checkboxes just a toggled image.