[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-user
Subject:    Re: [Gambas-user] Listview picture not showing...
From:       Fabien Bodard <gambas.fr () gmail ! com>
Date:       2011-02-26 21:41:40
Message-ID: AANLkTinrMEqDCVa-n_u_4enCVZX_5s70c4_Vn926MEoL () mail ! gmail ! com
[Download RAW message or body]

2011/2/26 Stephen Bungay <sbungay@csolve.net>:
>   This has undoubtedly been asked before.
>
> GAMBAS 2.2
>
>   I am trying to add an icon to the listview items, to that end this
> code snippet should do the trick;
>
> Private SUB Initialize_Listview1()
>   DIM Icon AS NEW Picture
>
>   Icon.Load("/home/username/mypicture.png") ' This png file is 26x16
> and has a transparent background
>   Listview1.Add("1","Entry 1", Icon)
>
> END
>
>   No errors generated, no picture appears in the listview. Examining
> the Icon object sees an hex value in Image and 0 width and 0 height.
>
>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>

you need to do like that :

Icon = Icon.load(...)

or just
Icon = Picture[...]



icon.load does not set the icon internally but just return a picture object

-- 
Fabien Bodard

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic