Git Product home page Git Product logo

gwidgets2's People

Contributors

jverzani avatar landroni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gwidgets2's Issues

example in `gexpandgroup`

Please add example in ?gexpandgroup:

if(interactive()) {
    w <- gwindow("Box containers")
    g <- gvbox(cont=w)                         # ggroup(horizonta=FALSE, ...)
    nb <- gnotebook(cont=g); gbutton("one", label="one", cont=nb)
    gframe("Frame", cont=g)
    pg <- gpanedgroup(cont=g); gbutton("one", cont=pg); gbutton("two", cont=pg)
    eg <- gexpandgroup(cont=g, horizontal=FALSE); glabel("Click above to hide", cont=eg); gbutton("one", cont=eg); gbutton("two", cont=eg)
}

document `expand`, `fill` where applicable

This issue is motivated by the sometimes missing documentation for expand, fill (and perhaps other) arguments.

For example gtext(cont=dlgg, expand=TRUE) is clearly a valid construct with a very specific outcome (different from gtext(cont=dlgg)), but ?gtext says absolutely nothing about expand.

Sometimes it's hard to figure out which widget supports which arguments.

two issues with gfilter() variable chooser

When you add item, gfilter() now automatically selects the first variable (which is useful). However the 'edit by' options are disabled. I think it should be easy to fix this.

The second issue is rather minor: If you try to increase the width of the window, the gedit() widget doesn't follow. I think it would be nice if it mirrored width changes in the gwindow().

`append=FALSE` and cursor placement/autoscrolling for `insert.GText`

Currently doing insert(gtext_obj, "asdf") will invariably prepend/append the text to existing text already in the widget. It would be useful to be able to replace existing text via an append=FALSE argument. Alternatively you could make the where= argument to take the values c("end", "beginning", "at.cursor", "replace").

Moreover, after a text is being inserted the window is scrolled to the end of the widget. Sometimes it would be better if the cursor ended up actually at the beginning of the widget. So how about adding a cursor.pos=c("default", "end", "beginning")? With "default" being the current behaviour, "end" placing the cursor and scrolling the window to the end of the text widget, and "beginning" placing the cursor and scrolling the window to the beginning of the text widget.

Icons in gWidgets2 + RGtk2

gWidgets2 v1.0-5 from CRAN with:

gWidgets2RGtk2 v1.0-2 from CRAN: stock icons are show only in toolbar.

gWidgets2RGtk2 from GitHub: stock icons are shown in toolbar, buttons, images, but are not shown in menu.

non-functional checkbox in gcheckboxgroup()

When searching for some "non-matched-string" in gcheckboxgroup() and the filtered list of checkboxes should be empty, a non-functional checkbox is instead presented to the user. This is on big deal, but it would be better to avoid displaying this. If possible, it would be nice to display a "No match found" message in such cases.

gcheckboxgroup: fix selection when filtering items

https://github.com/landroni/gWidgets2-filter/blob/master/gWidgets2-filter.R
require(MASS)
Xa <- Cars93 ## this will be in a function... replace with your won
dffilter(Xa)

Now Add item, Manufacturer, Multiple selection. Hit Clear button to select none. And proceed as follows:

  • type 'A' and select 'Acura', then delete 'A': In the list you will see 'Acura' selected
  • type 'A' again and select ', then delete 'A': In the list you will see 'Acura' and 'Audi' selected
  • type 'B' and select 'BMW', then delete 'B': In the list you will see only 'BMW' selected; this is unexpected

To my understanding what happens is that past selections get cleared when filtering the gcheckboxgroup items, and this is unexpected in many cases. If the user wants to clear past selection, she should simply use the Clear button. Moreover, this filtering system should allow the user to easily check disparate items: Audi and Saab. Now filtering for 'Audi' and checking then filtering for 'Saab' and checking would result only in Saab being checked, which is unhelpful.

Could this be fixed?

argument or method to assign icons and tooltips to tabs

As per http://stackoverflow.com/questions/24706434/how-to-assign-icons-to-gnotebook-tabs/24741832#24741832 , I was wondering if there should be gnotebook() argument or method to assign icons to tabs.

The following function can do this:

add_stock_icon <- function(nb, nm, page, left=TRUE){
    child <- nb$widget$getNthPage(page-1)
    box <- nb$widget$getTabLabel(child)
    icon <- gimage(stock.id=nm)
    box$packStart(icon$widget$parent)
    if(left) box$reorderChild(icon$widget$parent, 0)
}

Should there be something similar included in gWidgets2?

bug when selecting 'range' for 'factor' variable in gfilter

require(MASS)
data_set <- Cars93 ## this will be in a function... replace with your won

then using gfilter() select variable Model and option 'range' and hit OK. The window will refuse to close, among other buggy elements.

Using Gtk2

incorrect index returned by gcombobox() when typing in the value

gcombobox() doesn't return the correct index if the user types the value into the input box. This was originally discussed in #39, but I'm moving it to a separate ticket.

Here's a reproducible example of the issue:

w <- gwindow("Range widget", visible=T)
g <- ggroup(cont=w, horizontal=F)
sl <- gcombobox(1:10, cont=g, editable=T, use_completion=T)
  1. Use the combo to select 5 and then:

    svalue(sl); svalue(sl, index=T) ##OK
    [1] "5"
    [1] 5

  2. Erase 5, and type 4, then:

    svalue(sl); svalue(sl, index=T) ##Incorrect index
    [1] "4"
    [1] 0

So when typing in the value (whether 4 or 5 or 9), svalue(sl, index=T) always returns 0, which seems to be a bug.

gfilter related issue

Source https://github.com/landroni/gWidgets2-filter/blob/master/gWidgets2-filter.R

Then 'Add item' and select Manufacturer. Notice that you have 'Chrylser' twice in the list, although I suspect it should be displayed only once.

nchar(as.character(Cars93[ grepl('Chry', Cars93$Manufacturer), 1]))
[1] 8 8 8

But maybe something is fishy with the databse as the following yields only two hits:

nchar(as.character(Cars93[ Cars93$Manufacturer=='Chrysler', 1]))
[1] 8 8

unable to install from GIT

Today I'm unable to install gWidgets2 from GIT:

require(devtools)
Loading required package: devtools
install_github("gWidgets2", "jverzani")
Installing github repo(s) gWidgets2/master from jverzani
Installing gWidgets2.zip from https://api.github.com/repos/jverzani/gWidgets2/zipball/master
Error: client error: (403) Forbidden

Any ideas why this is happening? Is it an issue with github, or something local? Internet is working fine here.

addHandlerChanged() delay

In some instances (say, when using a gslider() ) it would be useful to be able to delay the triggering of addHandlerChanged() by a small amount of time, say 0.25sec, to avoid unnecessary UI slowness. (For example, when the user scrolls a slider which automatically triggers a relatively CPU intensive operation, then the scrolling of the slider becomes jerky. In these cases a small delay between the change and the triggering of the handler can be useful.)

Can this be done in gWidgets2?

svalue(gtext_obj) <- "asdf" drops font attributes

I'm wondering if this is expected behaviour.

w <- gwindow("gtext example", visible=FALSE)
g <- gvbox(cont=w)
t2 <- gtext("monospace", font.attr=list(family="monospace"), container=g)
visible(w) <- TRUE

Now if you do svalue(t2) <- "monospace", you will notice that the widget font is no longer Monospace. I would have expected that the attributes of a gtext() object were not dropped unless specifically requested.

Bug in RStudio Environment pane with gWidgets2 objects?

Try this in RStudio:

w <- gwindow("notebook example")
nb <- gnotebook(container=w)

Now in the RStudio Environment pane hit the "refresh" button and notice that the refresh happens as expected. Then close the w window and re-try the "refresh" button in RStudio. You should get:

Error in class(obj) <- "rs.scalar" : attempt to set an attribute on NULL
Error in class(obj) <- "rs.scalar" : attempt to set an attribute on NULL

To get rid of these messages you need to rm(w); rm(nb).

Is this an RStudio issue?

without an X display, gWidgets2 crashes R

Without an X display RGtk2 realizes that there is no display, but gWidgets2 crashes R nonetheless. To replicate on Linux:

DISPLAY=:1.1 R
source("gWidgets2-filter.R")
dffilter(iris)

Can gWidgets2 detect this and avoid crashing R?

*** caught segfault ***
address 0x18, cause 'memory not mapped'

Traceback:
1: .Call(name, ..., PACKAGE = PACKAGE)
2: .RGtkCall("S_gtk_container_add", object, widget, PACKAGE = "RGtk2")
3: method(obj, ...)
4: block$add(widget)
5: .Object$initialize(...)
6: initialize(value, ...)
7: initialize(value, ...)
8: methods::new(def, ...)
9: GText$new(toolkit, text = text, width = width, height = height, font.attr = font.attr, wrap = wrap, handler = handler, action = action, container = container, ...)
10: .gtext.guiWidgetsToolkitRGtk2(toolkit, text = text, width = width, height = height, font.attr = font.attr, wrap = wrap, handler = handler, action = action, container = container, ...)
11: .gtext(toolkit, text = text, width = width, height = height, font.attr = font.attr, wrap = wrap, handler = handler, action = action, container = container, ...)
12: gtext(cont = dlgg2, font.attr = list(family = "monospace"), width = 300, height = 25 * 6, expand = T, fill = T)
13: dffilter(iris)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 1
aborting ...

trouble with async commands

Sometimes I get in trouble by async evaluation of commands. Is it possible to run some commands in !async mode?

provide an 'items=' arg in gslider()

See #29 for some background. I feel a bit limited by the gslider() interface with regard to permitted steps. Would it be possible to allow an items= argument, as in gcombobox(), to allow the developer to use a pre-existing list of allowed steps (as from seq_sane())?

Radio button in the unexpected position

Hi John @jverzani ,
There is a doubtful point in my gWidgets2 design.
I want to add gradio inside the glayout.
Suppose I have a glabel at the 4th row, a small layout in the 6th row.
I defined a radio group in 5th row but it actually go the bottom of the layout, the 13rd row.. The layout I have defined had totally 14 rows...
More interesting is, if I set the radio group inside 15, it still be 13...if I set it inside 16,17,18,19,20, it is still 13rd. It always goes to the last second row..
Thank you.

better handling of all-NA variables _or_ subsets

Just checked and I think I still have trouble with this case. If you
https://github.com/landroni/gWidgets2-filter/blob/master/gWidgets2-filter.R
Xa$Man.trans.avail1 <- as.logical(Xa$Man.trans.avail)
dffilter(Xa, TRUE)

Then display Man.trans.avail1 column. You will notice that the column
class is 'logical', that checked checkboxes are displayed, and that
you cannot modify these checkboxes. I think that if a variable
contains only NAs, then we should display just that: NA. Inserting a
string or a number or a logical in any of the cells should
automatically switch the column class to 'character' or 'numeric' or
'logical'. What do you think?

  • As for all NA values, the odd thing is R will think this is a logical
    vector unless you do assignment with NA_real_ which of course no one does.
    I'll have to hack gtable to look at this case, but haven't done so yet.

gfilter: single choice item broken

Recent commits seem to have broken 'single' choice item in gfilter. When I try to add such item I get:
Error in use_completion() : object 'e' not found

gfilter: head/tail/some(..., 1000) preset

This is sitting rather high on my TODO list ( https://github.com/landroni/gWidgets2-filter/blob/master/TODO ), but I have trouble deciding how best to integrate it into gfilter().

I was thinking of providing a "preset" filtering item that could be 'Add'ed as other row filters, but instead of focusing on any given variable, it would present a generic interface for head(), tail() and car::some(). The funs are extremely useful when inspecting a data frame, for example when checking that some operation on a DF went as expected.

This thingy could take the form of a gfilterpreset() fun modeled on gfilter(), that when called via 'Add preset' would add a widget that has three radio choices c('head', 'tail', 'some'), with 'some' being disabled if package 'car' is not available and below either a scrollbar with 1:nrow(df) or a spinner with same range. I think it should be possible to checkbox negative for the range, as head and tail allow, but not some.

Is this feasible?

multiple selection for gcheckboxes

Would it be possible to have multiple selection mode for gcheckboxes? It should be possible to click on a checkbox and press shift and click on a different checkbox: all intermediary items should get checked, too.

Togglebuttons not displaying in a glayout

There appears to be a problem with the display of a togglebutton (in gcheckbox) within a glayout: neither the button nor the label appears. This worked fine with gWidgets. See example below:

library(gWidgets2)
options("guiToolkit"="RGtk2")
w1=gwindow()
w2=glayout(container=w1)
w2[1,1]=gcheckbox("test",use.togglebutton=TRUE)

tweak gradio() docs

Please document in ?gradio that the argument items "can be a character vector or a named character vector". Perhaps amending the example to show off how it works would be useful, too. Say add:

gradio(c('a'='Letter A', 'b'='Letter B', 'c'='Letter C'), selected=1, horizontal=TRUE, cont=fl, label="gradio")

Moreover, the examples use the label argument, but it doesn't seem documented. This holds for ?gradio, ?gcheckbox, etc. Is this an omission?

freeze row names in gdf()

Now in gdf() column names are frozen when scrolling vertically. It would be nice if the same effect for row names: when scrolling horizontally, freeze row names. Could this be done?

Malloc error when displaying a gbasicdialog

I have recently installed gWidgets2 and gWidgets2Rgtk2 on my Mac. A simple test fails with an error in malloc. Before failing, it does show a window with an Ok and Cancel button.

Here is what I am doing, running right after starting R:

require(gWidgets2)
Loading required package: gWidgets2
Loading required package: digest
w <- gbasicdialog(title="Hello, World")
Loading required package: gWidgets2RGtk2
Loading required package: memoise
Loading required package: RGtk2
visible(w, set=TRUE)
R(14313,0x7fff7e9fd960) malloc: *** error for object 0x4024000000000000: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6

I am running:

  • R 3.0.1
  • gWidgets2 1.0-1
  • gWidgets2RGtk2 1.0-1
  • RGtk2 2.20.25
  • GTK+ 2.24.17
  • Mac OS 10.7.5

I would appreciate any help in solving this.

Barbara

improvements to edit factor levels

I am now experimenting with edit factor levels in gdf(), and I must admit I'm a bit confused by the interface. First, I see no way to re-order factor levels. Maybe an interface to relevel() would be useful?

Second, the message on the right is long and convoluted. I'm not sure how to proceed, and what it will achieve. If I select a level (as the message suggests), nothing happens. If I double-click (what the message should probably indicate), then I get into the input box on the right. But then: if I put in a new name and enter nothing happens; if I select an existing level, I don't see anything happening either.

And last, I think it should be possible to add new levels (in addition to existing ones). Or is it a bad idea?

`editable=FALSE` for gtext()

Please allow for gtext() widget to be read-only. I would like for the user to be able to see a cursor and move the cursor (as it is), but simply be unable to perform any modifications via the keyboard (the current feature request). This can be useful when you want to output in the GUI, say,

> describe(iris[ , 3:5])
iris[, 3:5] 

 3  Variables      150  Observations
----------------------------------------------------------------------------------------------
Petal.Length 
      n missing  unique    Mean     .05     .10     .25     .50     .75     .90     .95 
    150       0      43   3.758    1.30    1.40    1.60    4.35    5.10    5.80    6.10 

lowest : 1.0 1.1 1.2 1.3 1.4, highest: 6.3 6.4 6.6 6.7 6.9 
----------------------------------------------------------------------------------------------
Petal.Width 
      n missing  unique    Mean     .05     .10     .25     .50     .75     .90     .95 
    150       0      22   1.199     0.2     0.2     0.3     1.3     1.8     2.2     2.3 

lowest : 0.1 0.2 0.3 0.4 0.5, highest: 2.1 2.2 2.3 2.4 2.5 
----------------------------------------------------------------------------------------------
Species 
      n missing  unique 
    150       0       3 

setosa (50, 33%), versicolor (50, 33%), virginica (50, 33%) 
----------------------------------------------------------------------------------------------

You would want the user to easily select and copy the text, but NOT inadvertently modify it.

WM icon in gWidgets applications

Is it possible to assign, for example, R's icon to the window() instances of gWidgets? If not, could this be implemented? Currently on Xfce you simply get a missing app icon for gWidgets instances.

Error message when using stock icons with gimage

This works fine using the original gWidgets package (with RGtk2), but with gWidgets2 I get an error.

For example (where "newpng.png" was added using addStockIcons):
gimage("newpng",dirname = "stock",container=g)
File stock/newpng is not found
Error in .Object$initialize(...) :

Is this a minor bug or is there a workaround for this?
Many thanks,
Patrick

gcombobox errors with Gtk2

gcombobox with Gtk2 will not work for item strings less than 3 characters (not the case when using tcltk or the originial gWidgets packages with Gtk2). See 3 examples below where I increment the length of the strings to be presented in the gcombobox:

w=gwindow()
gcombobox(c("a","b"),container=w)
Error in [[.GObject(x, member, where = ) :
Cannot find 'setWidthRequest' for classes GtkComboBox, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject

gcombobox(c("aa","bb"),container=w)
Error in [[.GObject(x, member, where = ) :
Cannot find 'setWidthRequest' for classes GtkComboBox, GtkBin, GtkContainer, GtkWidget, GtkObject, GInitiallyUnowned, GObject, RGtkObject

gcombobox(c("aaa","bbb"),container=w)
Object of class GComboBoxNoEntry

thanks
Pat

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.