Eto macOS - Eto.Forms.DropDown issue

problems 4 Eto.Forms.DropDown

  System.Drawing.Bitmap original = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(opt);
                System.Drawing.Bitmap resized = new System.Drawing.Bitmap(original, new System.Drawing.Size(sizz, sizz));


                // System.Drawing.ImageConverter converter = new System.Drawing.ImageConverter();
                // byte[] bb = (byte[])converter.ConvertTo(resized, typeof(byte[]));

                Bitmap rImage = Rhino.UI.EtoExtensions.ToEto(resized);

                Image image = new Bitmap(rImage);

does not resize the window. Eto.Forms.DropDown does not resize the height.

Hi @taraskydon,

Can you provide code to a working sample, that we can run here, that demonstrates the issue?

Thanks,

– Dale

ToolPanel.zip (2.2 MB)
ToolPanelTESTui.rhp (207 KB)

Hey @taraskydon,

DropDowns on macOS have a fixed size and there’s no way to change that. You will have to make your own control based on Drawable if you want something to have a different size/appearance.

Hope this helps!

1 Like

I’d like to have more nativeness for EtoUI so I don’t have to rewrite the code for each system. I wonder if there is such a problem in Eto version 2.8.2 in MacOS Rhino8?

This is a problem with the NSPopUpButton which Eto’s DropDown uses. It does not support variable height. The only option is to not use NSPopUpButton/DropDown.

Another option is you could use is a simple Button (which does support variable height), and when clicked show a ContextMenu to change the selection.

Hope this helps!

Thank you. I found another problem. With the slider function (TickFrequency). on macos if a slider with a large number that affects the number (TickFrequency) of slider forms may not open at all or it takes a very long time to open… there’s also the problem of (Form.Screen.GetImage) in MacOs , the resulting picture is a compressed image. at the output :joy:

I think the solution to this is to set a reasonable TickFrequency based on the range of the slider.

Hm, I haven’t seen that before. You can also use CMD+Shift+4 to take screenshots on Mac.

Hope this helps.