yglukhov / nimx

GUI library
MIT License
1.09k stars 75 forks source link

Popup button breaks if used alongside makeLayout #501

Open tatjam opened 2 years ago

tatjam commented 2 years ago

For example:

 var wnd = newWindow(newRect(40, 40, 800, 600))
 let pb = PopupButton.new(newRect(120, 90, 120, 20))
 pb.items = @["Popup button", "Item 1", "Item 2"]
 v.addSubview(pb)

works fine, but adding a makeLayout will break it completely:

var wnd = newWindow(newRect(40, 40, 800, 600))
wnd.makeLayout:
  - Label as statusText:
      center == super
      size == super
      text: "status"
 let pb = PopupButton.new(newRect(120, 90, 120, 20))
 pb.items = @["Popup button", "Item 1", "Item 2"]
 v.addSubview(pb)

In the last case, the popup button appears as text in the upper left corner of the window and is impossible to interact with.

tatjam commented 2 years ago

I forgot to mention, if the popup button is added via the makeLayout, it will render fine but the menu will not work properly.