1

I have a button like this :

obj4 <-gbutton("+",container=group2)

and I have some combobox that I create dynamically :

drp <- gcombobox(items = items, editable = TRUE, cont = group2)
obji<-gbutton("Ajouter au lexique",container=group2,horizontal=FALSE)
addHandlerClicked(obj4,handler = function(h,...){
drp <- gcombobox(items = items, editable = TRUE, cont = group2)
obji<-gbutton("Ajouter au lexique",container=group2,horizontal=FALSE)
})

The window and groups are defined like this :

win <- gwindow("Recherche de rapports", visible=TRUE)
group <- ggroup(horizontal = FALSE, container=win)
group2 <- ggroup(horizontal = TRUE, container=group)

I actually have three questions :

1) How to make that each button objiis under the drpcombobox each time it is created ?

2) How to make that obj4button is always at the right of all the obji (always at the end) ?

3) How to make that the widgets I add automatically appear at next line when the first line of the window is completely full rather than creating an awful horizontal scrollbar ?

MysteryGuy
  • 1,091
  • 2
  • 18
  • 43
  • 1
    The gWidgets methods for adding widgets are not as feature rich as the native toolkits. You would have to use combinations of containers to do some such. For example, one box container to hold dynamic widgets and another to hold the `obj4` button, then you can pack these containers as you want. For top down alignment, you might also want to use the `gtable` layout, packing in box containers within cells, as needed. (I've found it helpful to draw a picture of what you want, and then try and circle widgets with boxes to figure out how to layout the interface.) – jverzani Apr 30 '18 at 15:57
  • @jverzani Thank you for you comment. Could you try to make an answer with code adapted to my case, please ? – MysteryGuy Apr 30 '18 at 16:01
  • @jverzani Moreover, when I add too many `drp`, it creates a long line, going beyond the window... Is there a way to limit the size of the window and rather put these `drp`a line below ? – MysteryGuy Apr 30 '18 at 16:35

0 Answers0