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

jverzani jverzani at gmail.com
Tue May 5 02:43:11 CEST 2009


Ulrike Grömping <groemping <at> bht-berlin.de> writes:

.. snip ..

> Now I want to disable or hide some tabs, if certain conditions are true. 
> I've been able to conditionally disable all kinds of non-tab controls, 
> but the tabs of the notebook so far resist my efforts. The TclTk help 
> for ttk::notebook lists the widget command "pathname tab tabid ?-option 
> ?value ..." which I believe is the correct one, but I can't figure out 
> how to make R transfer that command to tcl. I believe that the tabid 
> values in the comments after tkadd are the correct ones for this 
> command, but I'm not even sure about that. Everyting I've tried doesn't 
> quite make sense to me, the last tries were along the lines of
> 
> .Tcl(tn, "tab", paste(4, "-state","disabled",sep=" " )),
> 
> after using .Tcl.args and other things failed. But no luck nowhere.
> 


The tcl() function is what you want here. Use 0-based indexing. SO to hide tab 1
and disable tab 2, you would have:

tcl(tn, "tab", 0, state="hidden")
tcl(tn, "tab", 1, state="disabled")

--John


> Any ideas ?
> 
> Regards, Ulrike
>



More information about the R-SIG-GUI mailing list