[Gambas-user] About the origin of Stock Icons

Jorge Carrión shordi at gmail.com
Mon Feb 20 17:57:32 CET 2023


And I have a question that originates all this problem about icons: Is it
possible to know the name of the icon assigned to a control, say a Button?
I've tried some ways... but all failed.

Best regards

El lun, 20 feb 2023 a las 17:11, Gianluigi (<gradobag at gradobag.it>)
escribió:

> Il 20/02/23 14:47, Gianluigi ha scritto:
> > Il 20/02/23 14:44, Gianluigi ha scritto:
> >> Il 20/02/23 14:29, Fabien Bodard ha scritto:
> >>> because Stock["24" &/ sIcon return a null picture ? so a null Image
> >>
> >>
> >> :-D
> >>
> >> I think I have it figured out, at least partially.
> >>
> >> I have deleted the old, messy IconsStockTest project and overwritten
> >> it with a fresh one and the project works even on the dark theme, see
> >> attached image.
> >>
> >> So if you change the theme you need to overwrite the project.
> >>
> >> What do you guys think?
> >>
> >> Regards
> >>
> >> Gianluigi
> >>
> >>
> >> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >
> > The forgotten image
>
>
> Hi Fabien,
>
> so It Works:
>
> Public Sub Form_Open()
>
>    Dim sIcon As String
>
>    '-- loads system icons if they exist
>    For Each sIcon In Stock.Icons
>      If Application.DarkTheme Then
>        IconView1.Add(sIcon, sIcon, Stock["24" &/
> sIcon].Image.Invert().Picture)
>      Else
>        IconView1.Add(sIcon, sIcon, Stock["24" &/ sIcon])
>      Endif
>    Next
>    ' '-- load only stock icons without mixing them with system icons
> (from a post by Fabien)
>    For Each sIcon In Stock.Icons
>      If Application.DarkTheme Then
>        IconView2.Add(sIcon, sIcon, Stock["24/$(mime)" &/
> sIcon].Image.Invert().Picture)
>      Else
>        IconView2.Add(sIcon, sIcon, Stock["24/$(mime)" &/ sIcon])
>      Endif
>    Next
>
> End
>
> But the result is horrible :-(
>
> Gianluigi
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20230220/55d11925/attachment.htm>


More information about the User mailing list