[R] RGtk2 / gWidgets - addHandlerClicked Problem
David Winsemius
dwinsemius at comcast.net
Sun Dec 27 18:34:19 CET 2009
On Dec 27, 2009, at 12:12 PM, Mark Heckmann wrote:
> Hi David,
>
> forgot to mention I use the RGtk2 GUI toolkit.
>
> options("guiToolkit"="RGtk2")
>
> Under tcl I do not get this results neither. Under RGtk2 I do (Mac
> OS 10.6.1, R 2.10.0 32-bit).
>
> Any ideas?
I don't have anything constructive to offer. Any time I try to run a
package that depends on Gtk2+ I fail at some point in ways that seem
to depend on compilation options or resources that I do not have
correctly arranged in my libraries. My questions to the R-Mac-SIG list
list seem to be taken as evidence of irremediable *NIX cluelessness.
So I have decided to spend my time on other, more productive pursuits.
--
David
>
> TIA!
> Mark
>
>
> Am 27.12.2009 um 18:05 schrieb David Winsemius:
>
>>
>> On Dec 27, 2009, at 11:29 AM, Mark Heckmann wrote:
>>
>>> In The following code, the table handler is executed twice when
>>> the button is pressed (from the 2nd pressing on).
>>
>> Can't reproduce. On a Mac 10.5.8, R 2.10.1, running the 64 bit GUI,
>> after choosing the gWidgetstcltk option for GUI toolkit when
>> gwindow() is first executed, I do not get a behavior that suggests
>> that the table handler gets executed twice with each button click.
>> I get an X11 window with a button across the width of the top of
>> the window. Each time the button is clicked I get :
>> >
>> addhandlerclicked button
>> addhandlerclicked table
>>
>> Just for fun I modified your tbl handler and got sensible
>> incrementing highlighting of the rows with:
>> > addhandlerclicked(b, handler=function(h, ...){
>> + cat("addhandlerclicked button\n")
>> + svalue(tbl, index=T) <- 1+svalue(tbl) # the earlier code did not
>> change values
>> + })
>>
>>
>>> I want it to be executed only once. Does someone know, why this
>>> happens and how I can change it?
>>>
>>> library(gWidgets)
>>>
>>> w <- gwindow()
>>> b <- gbutton("press", cont=w)
>>> tbl <- gtable(1:10, cont=w)
>>>
>>> addhandlerclicked(b, handler=function(h, ...){
>>> cat("addhandlerclicked button\n")
>>> svalue(tbl, index=T) <- 1 # change the table value
>>> })
>>> addhandlerclicked(tbl, handler=function(h, ...){
>>> cat("addhandlerclicked table\n")
>>> })
>>>
>>> Thanks!
>>> Mark
>> --
>>
>> David Winsemius, MD
>> Heritage Laboratories
>> West Hartford, CT
>
> –––––––––––––––––––––––––––––––––––––––
> Mark Heckmann
> Dipl. Wirt.-Ing. cand. Psych.
> Vorstraße 93 B01
> 28359 Bremen
> Blog: www.markheckmann.de
> R-Blog: http://ryouready.wordpress.com
>
>
>
>
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
More information about the R-help
mailing list