Is it possible to have a different set of toolbar graphics for Windows and Mac?

  1. last week

    Is it possible to have a different set of toolbar graphics for Windows and Mac programmatically? .. on account windows doesn't scale at all. Thanks Windows.

  2. Jean-Yves P

    Jul 10 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited last week

    install all the buttons and icons you need in the IDE, then make them visible or not by program.

  3. Scott C

    Jul 10 Pre-Release Testers, Xojo Pro Vancouver, Canada

    Maybe I don't understand the challenge, but if you do want to use the same images for your toolbar buttons for both Mac & Windows, I think this does work, providing you setup your images correctly.

    I'm using Xojo 2019r1.1 and my current project has a toolbar and the images look and scale the same on Mac & Windows 10 (whether 100, 150 or 200%).

    In my case, I added some images ("Insert" menu > "Image"), then added three sized *.png images for my icons, starting at 32x32 (@1), then 64x64 (@2) and 96x96 (@3). These sized versions should be accurate for each size (true 32x32, 64x64 & 96x96 representation of the image), and not a rescaled version of the same original image that you've resized yourself in an image editor - if that makes sense?

    Then from the Toolbar Inspector, I selected my images from the "Icon" drop-down for each of the buttons. When I run the app, the appropriate image should show for the given screen scaling.

    The only annoying difference I found with the Toolbar is that Windows doesn't support the Flexible Space feature. But I can live with that.

    Or is this a problem for older versions of Windows than 10?

    I hope some of this helps.

  4. If you intend to set images different for Mac and for Windows, then do it after you are sure that the toolbar has been initialized.
    Something like this:

    if Toolbar11.ToolItem1.icon <> nil then
    #if targetWindows
     //apply the icons for Win
    #else
     //apply the icons for Mac
    #endif
    end if
  5. Michel B

    Jul 11 Pre-Release Testers RubberViews.com
    Edited last week

    Actually, you can set the icons in the IDE for your main platform, and use the conditional execution of applying icons only for the other platform.

  6. Emile S

    Jul 11 Europe (France, Strasbourg)

    @Michel:
    … and if you forgot you’ve done that and load the project from your other platform OS laptop…

  7. Edited last week

    Actally I use the snippet above to change icons and their captions on the fly, since that particular app needs that kind of approch..
    Otherwise one could initialize the toolbar in its open event.

  8. Michel B

    Jul 11 Pre-Release Testers RubberViews.com

    @Emile S @Michel:
    … and if you forgot you’ve done that and load the project from your other platform OS laptop…

    It does not matter. Conditional compilation does not depend on the platform the project runs on.

  9. Emile S

    Jul 11 Europe (France, Strasbourg)

    @Michel B you can set the icons in the IDE for your main platform

    I certainly misread. I understand: “the main platform is the running platform.” So, this part is not conditional.

or Sign Up to reply!