[MAXGUI] How to make a "Voting Box"?

BlitzMax Forums/BlitzMax Beginners Area/[MAXGUI] How to make a "Voting Box"?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This whole method stuff is new to me.

	Method Hide()
    	HideGadget (canvas)
        hidden=True 
    End Method 

    Method Show()
        ShowGadget (canvas) 
        hidden=False 
    End Method 

	Method update()
		Local t:Int
		Local mini:Int
		Local gh:Int=GadgetHeight(canvas)

            If hidden=False Then ' Unitbar hidden completely?

		    SetGraphics CanvasGraphics(canvas)
			SetClsColor 0,0,0;Cls
            
            If disabled=False Then ' Draw an enabled Unitbar only
 
            SetColor 100,100,100 
			For t=value To units
				DrawRect (number*12)+t*unitwidth+1,1,unitwidth-2,gh-1-1
			Next
						
			For t=1 To value
				SetColor r[t],g[t],b[t]
				DrawRect (number*12)+t*unitwidth+1,1,unitwidth-2,gh-1-1
			Next

			SetColor 255,255,255
			DrawText value,number*12/2-TextWidth(value)/2,gh/2-TextHeight(value)/2

            Else ' Draw an empty Unitbar

            SetColor 100,100,100 
			For t=1 To units
				DrawRect (number*12)+t*unitwidth+1,1,unitwidth-2,gh-1-1
			Next
					
			value=0 				
			SetColor 255,255,255
			DrawText value,number*12/2-TextWidth(value)/2,gh/2-TextHeight(value)/2

            EndIf ' Disabled

            EndIf ' Hidden
			Flip
	End Method


Better this way?!?^^

This canvas stuff drives me crazy. Why can't one simply resize it. Is it a bug or has it to be that way? 1.18