PureBasic 5.70 GadgetHeight() does not work!

Just starting out? Need help? Post your questions and find answers here.
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

PureBasic 5.70 GadgetHeight() does not work!

Post by Mijikai »

Here is my last attempt of posting a Bug report!
The one before was trashed but as it turned out #Null$ does not even work in the current release -> viewtopic.php?p=531591#p531591 :evil:...

Code:

Code: Select all

If OpenWindow(0,10,10,100,100,"")
  CanvasGadget(1,10,10,80,80)
  Debug GadgetHeight(1,#PB_Gadget_ActualSize);OK!
  Debug GadgetHeight(1,#PB_Gadget_RequiredSize);FAILS!
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
  CloseWindow(0)  
EndIf 
Good luck...
User avatar
blueb
Addict
Addict
Posts: 1044
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: PureBasic 5.70 GadgetHeight() does not work!

Post by blueb »

Hmm.. appears as if #PB_Gadget_RequiredSize needs to be initiated?
using Win 10 5.7(x86)

Code: Select all

If OpenWindow(0,10,10,100,100,"")
  CanvasGadget(1,10,10,80,80)
  Debug GadgetHeight(1,#PB_Gadget_ActualSize);OK!
  Debug GadgetHeight(1,#PB_Gadget_RequiredSize + 1); WORKS!
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
  CloseWindow(0)  
EndIf
- It was too lonely at the top.

System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
mk-soft
Always Here
Always Here
Posts: 5405
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: PureBasic 5.70 GadgetHeight() does not work!

Post by mk-soft »

Same result on pb v5.62

Code: Select all

If OpenWindow(0,10,10,100,100,"")
  CanvasGadget(1,10,10,80,80)
  ;StringGadget(1,10,10,80,80, "Text")
  Debug GadgetHeight(1,#PB_Gadget_ActualSize);OK!
  Debug GadgetHeight(1,#PB_Gadget_RequiredSize);NO FAILS!
  Repeat
    event = WaitWindowEvent()
    If EventGadget() = 1 And EventType() = #PB_EventType_LeftClick
      Debug GadgetHeight(1,#PB_Gadget_RequiredSize);NO FAILS!
    EndIf
  Until event = #PB_Event_CloseWindow
  CloseWindow(0)  
EndIf 
Required size of canvas gadget is zero...

No problem
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: PureBasic 5.70 GadgetHeight() does not work!

Post by Little John »

mk-soft wrote: Required size of canvas gadget is zero...

No problem
I agree. Before using the flag #PB_Gadget_RequiredSize does make sense, there have to be defined any requirement. :-)
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: PureBasic 5.70 GadgetHeight() does not work!

Post by Josh »

Although #PB_Gadget_RequiredSize doesn't make much sense with the CanvasGadget, it should work because it works also with other gadgets like the ImageGadget:

Code: Select all

If OpenWindow(0,10,10,100,100,"")
  ImageGadget(1,10,10,80,80,0)
  Debug GadgetHeight(1,#PB_Gadget_ActualSize)
  Debug GadgetHeight(1,#PB_Gadget_RequiredSize)
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
  CloseWindow(0)  
EndIf 
@Blues
Blues wrote:

Code: Select all

Debug GadgetHeight(1,#PB_Gadget_RequiredSize + 1); WORKS!
You can't just change the flag to an undefined value and say it works.
sorry for my bad english
Fred
Administrator
Administrator
Posts: 16686
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureBasic 5.70 GadgetHeight() does not work!

Post by Fred »

Required size of a canvas is always 0
Post Reply