[R-gui] tcltk notebook question: Accessing tabs in ttknotebooks

groemping at bht-berlin.de groemping at bht-berlin.de
Wed May 6 00:36:22 CEST 2009


Thanks, John!

tkwinfo(tn, "exists") yields the following error:

Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), class =
"tclObj") : 
  [tcl] bad option ".3.1": must be cells, children, class, colormapfull,
depth, geometry, height, id, ismapped, manager, name, parent, pointerx,
pointery, pointerxy, reqheight, reqwidth, rootx, rooty, screen, screencells,
screendepth, screenheight, screenwidth, screenmmheight, screenmmwidth,
screenvisual, server, toplevel, viewable, visual, visualid, vrootheight,
vrootwidth, vrootx, vrooty, width, x, y, atom, atomname, containing, interps,
pathname, exists, fpixels, pixels, rgb, or visualsavailable.

An analogous error with a shorter bad option (e.g. ".7") is thrown, if I ask
for existence of the top level window (which is called topdes2). 

What really confuses me here: I obtained the numerical tab id by processing
tclvalue(tcl(tn, "select")), i.e. tn did exist before. Then I destroyed the
parent of tn and recreated it (and it is created OK). I don't see any reason
whatsoever why the recreated menu should not have the same structure as before
(I haven't changed any parameters), i.e. it should also have tn available. I
have the feeling that something weird is happening with "."s, but I know too
little about tcl to be sure about anything.

Regards, Ulrike

---------- Original Message ----------- 
 From: jverzani <jverzani at gmail.com> 
 To: r-sig-gui at stat.math.ethz.ch 
 Sent: Tue, 5 May 2009 21:54:54 +0000 (UTC) 
 Subject: Re: [R-gui] tcltk notebook question: Accessing tabs in ttknotebooks

> Ulrike Grömping <groemping <at> bht-berlin.de> writes: 
> 
> > 
> > Dear John, dear all, 
> > 
> > while John's solution helped nicely for modifying the state of a tab, I 
> > am again stuck with selecting a tab. I've managed to capture the tabs 
> > numeric id (0-based). But using tkselect or tcl does not get me where I 
> > want. The code below shows a simplified version of what I tried: 
> > 
> >         Rcmdr.new.FrF2()     ## displays a window that contains a 
> > notebook (named tn) with 6 tabs 
> >                              ## and the first tab selected with one 
> > widget having the focus 
> >         tcl(tn, "select", 1) ## for selecting the second tab; produces 
> > an error and leaves first tab selected 
> > 
> > Error message: 
> > Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"), 
> > class = "tclObj") : 
> >   [tcl] invalid command name ".179.1" 
> > 
> 
> You have the right command: tcl(tn, "select", 1) 
> The error suggests the tn "window" does not exist. Check it first with
something 
> like: tkwinfo(tn, "exists") to see what is happening. 
> 
> Hope that helps, 
> 
> --John 
> 
> > What am I doing wrong ? Again, any help is appreciated! 
> > 
> > Regards, Ulrike 
> > 
> 
> _______________________________________________ 
> R-SIG-GUI mailing list 
> R-SIG-GUI at stat.math.ethz.ch 
> https://stat.ethz.ch/mailman/listinfo/r-sig-gui 
------- End of Original Message -------



More information about the R-SIG-GUI mailing list