Skip to content

[Mac] fix color chooser sample #226

wants to merge 1 commit into from

2 participants

dlech commented Jul 13, 2013

Color chooser sample is broken on Mac. There are 2 separate problems.

  1. Color chooser uses XwtWidgetBackend instead of a native backend, so trying to cast the backend to a ViewBackend throws and exception. I added the method GetNativeBackend() to recursively get a ViewBackend object in the case of an XwtWidgetBackend object.

  2. After fixing the above problem, there is no more exception thrown, but the color chooser is still not visible. It turns out you need to call SetAutosizeMode (true) in order for it to be visible, so I added code to set this for all XwtWidgetBackend objects.

Mono Project member
sevoku commented Jul 17, 2014

I can confirm that this patch works. Would be nice, if it could be merged 👍

Mono Project member
sevoku commented Jan 16, 2015

After some testing and playing around it looks like setting SetAutosizeMode(true) is not the right way, since the child will always have the same size. I've merged your fix into #446 and added direct resizing to CustomWidgetBackend. Works for the ColorChooser and the new FontChooser (#443).

@sevoku sevoku closed this Jan 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.