PB5.51 (x86); Win7; TreeGadget; SetGadgetItemState;

Windows specific forum
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

PB5.51 (x86); Win7; TreeGadget; SetGadgetItemState;

Post by HanPBF »

Hello,

I consider this a bug either in behaviour or in documentation.

Code: Select all

define Win, i
Win = OpenWindow(#PB_Any, 0, 0, 355, 180, "TreeGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
if Win
	StringGadget(1, 10, 0, 160, 24, "Test")
  TreeGadget(0, 10, 32, 160, 160)
  
  for i = 0 to 10
  	AddGadgetItem (0, -1, "Item " + Str(i), 0, 0)
  next
  
  SetActiveGadget(0); comment this means selection does not work
  SetGadgetItemState(0, 3, #PB_Tree_Selected)
  SetActiveGadget(1); comment this keeps selection of tree item
  repeat : until WaitWindowEvent() = #PB_Event_CloseWindow
endif
My aim was to input something in textbox which is search in tree view then expanded and selected.

When I put focus back into StringGadget after getting that setGadgetItemState did only work after SetActiveGadget(#Tree), I noticed selection was also gone...

Any tricks to solve this?

Unfort. RSBasic.de has nothing in this direction.
Any link to the problem?


Thanks a lot in advance!

Regards!
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: PB5.51 (x86); Win7; TreeGadget; SetGadgetItemState;

Post by HanPBF »

o.k. setting a gadget active and keeping it select does not work...

I checked using checkboxes of treegadget, which seems to work.
HanPBF
Enthusiast
Enthusiast
Posts: 563
Joined: Fri Feb 19, 2010 3:42 am

Re: PB5.51 (x86); Win7; TreeGadget; SetGadgetItemState;

Post by HanPBF »

Damned... missed #PB_Tree_AlwaysShowSelection

o.k. color only lightgrey...
Post Reply