It is currently Fri May 25, 2018 9:48 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: ImageGadget -a missing part
PostPosted: Wed Apr 25, 2018 7:52 am 
Offline
Addict
Addict

Joined: Sat Mar 02, 2013 9:17 am
Posts: 922
Hello, Andre,
The ImageGadget lacks an extended explanation how to change the image of the gadget afterwards
It may sound trivial, but it has been a topic for years that people don't know how to do it.

Another very unsettling part is that you don't see the image gadget if it has no valid content, so it is empty, which you should point out
The last thing missing is a hint that you have to set a size and a frame as flag to display an empty gadget

Change the image later :
SetGadgetState(#ImageGadget, ImageID(#Image))

Regards Werner

_________________
http://www.nachtoptik.de


Top
 Profile  
Reply with quote  
 Post subject: Re: ImageGadget -a missing part
PostPosted: Thu Apr 26, 2018 4:44 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 3:47 am
Posts: 2067
Location: Singapore
walbus wrote:
The ImageGadget lacks an extended explanation how to change the image ... don't see the image gadget if it has no valid content ... have to set a size and a frame as flag to display an empty gadget...

Hi Werner. Some fairly valid points, although mostly implied; IMHO. :)

The SetGadgetState() function, requiring only the gadget number and desired image ID, is quite intuitive. It acts as an extension of the ImageGadget() function itself, without the positioning and dimensional metrics or optional flags.
Code:
;instantiate image gadget
ImageGadget(0, 10, 10, 50, 50, ImageID(0))

;change gadget image
SetGadgetState(0, ImageID(1))

And speaking of flags, it's also quite clear that the existence of a border flag would imply that the gadget itself is borderless, as image controls should be, to facilitate the placement of alpha-based transparencies.

However, the third point is moot, as no gadget would appear unless it has a positive size. The image gadget is an exception because it auto-sizes itself to the dimensions of the image, which is clearly indicated in the manual.
The PureBasic Manual wrote:
The gadget adjusts its width and height to fit the displayed image. The specified width and height are only used when no image is displayed.

Nevertheless, expanded descriptions are always more helpful.

_________________
Texas Instruments 99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye