icon inside a gridview cell

New to Gambas? Post your questions here. No question is too silly or too simple.
Post Reply
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

icon inside a gridview cell

Post by gambafeliz »

Is it possible to load an icon into a GridView cell?

Otherwise, how would they do something like that?
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: icon inside a gridview cell

Post by BruceSteers »

Sure...
GridView1[0,0].Picture = Picture["/my/pic.png"]
http://gambaswiki.org/wiki/comp/gb.qt4/ ... ll/picture
If at first you don't succeed , try doing something differently.
BruceS
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: icon inside a gridview cell

Post by gambafeliz »

Perfect, thank you very much.

And it occurs to you, how to stretch the image of the cell? or do I have to fit the image to the cell space?
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
User avatar
BruceSteers
Posts: 1523
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: icon inside a gridview cell

Post by BruceSteers »


GridView1[0, 0].Picture = Picture["/my/pic.png"].Image.Stretch(64, 64).Picture

' resize grid cell to fit picture
GridView1.Rows[0].Height = -1
GridView1.Columns[0].Width = -1

If at first you don't succeed , try doing something differently.
BruceS
User avatar
gambafeliz
Posts: 139
Joined: Friday 2nd September 2022 7:50pm
Location: I live in the same city as Picasso

Re: icon inside a gridview cell

Post by gambafeliz »

Thank you Mr. You leave me amazed. +10
For your misfortunes I am Spanish and I only know Spanish, please, be patient with me, Thank you. :)
Post Reply