jverzani / gWidgetsWWW2

gWidgets API for web programming
7 stars 2 forks source link

gedit does not increase width of input area when width is increased #13

Closed jranke closed 10 years ago

jranke commented 10 years ago

Test script:

w <- gwindow()
g <- ggroup(cont = w, horizontal = FALSE)

line_1 <- ggroup(cont = g, horizontal = TRUE)
glabel("Test label", cont = line_1)
e <- gedit("Test gedit, default width of 25", cont = line_1)
glabel("Second test label", cont = line_1)

line_2 <- ggroup(cont = g, horizontal = TRUE)
glabel("Test label", cont = line_2)
e <- gedit("Test gedit, increased width of 50", width = 50, cont = line_2)
glabel("Second test label", cont = line_2)

Result:

gedit_test

jverzani commented 10 years ago

Hmm, The docs for that are here: http://www.objis.com/formationextjs/lib/extjs-4.0.0/docs/api/Ext.form.field.Text.html

I have set the width argument which seems to onlyadjust the width of the field, but not the interior widget. However, I tried modifying the code to set size and that doesn't work as I expected. Not sure what to do about this. A partial workaround is to automatically grow the field. This can be done by passing an extra argument through ext.args:

e <- gedit("Test gedit, increased width of 50", width = 50, cont = line_2, ext.args=list(grow=TRUE))
jranke commented 10 years ago

Ah, thanks for the workaround. I noticed that using

..., ext.args = list(width = 8 * 50), 

does what I originally wanted.