Panel Gadget & Dategadget together does not work ?!!!

Just starting out? Need help? Post your questions and find answers here.
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Panel Gadget & Dategadget together does not work ?!!!

Post by guruk »

Hi,
In my example Code: Only the first DateGadget is working.
The second (ON the Panel) does not work!!!
Why??

I need a DateGadget on a Panelgadget....

Procedure Open_Panel_0()
If OpenWindow(0, 373, 151, 648, 439, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Panel0")
If CreateGadgetList(WindowID())

;- Panel0
PanelGadget(0, 18, 63, 603, 267)
AddGadgetItem(0, -1, "Tab 1")
CloseGadgetList()

EndIf
EndIf
EndProcedure

Open_Panel_0()
DateGadget(11, 156, 146, 110, 25, "Datum: %mm/%dd/%yyyy Zeit: %hh:%ii")
DateGadget(22, 156, 14, 110, 25, "Datum: %mm/%dd/%yyyy Zeit: %hh:%ii")
Repeat
While WindowEvent(): Delay(1) : Wend
ForEver
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Because you create it behind the panel so that all clicks are stopped by the panel. You must remove CloseGadgetList().
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

you were trying to add gadgets to a panel when its gadget list was not open or being used. try this:

Code: Select all

Procedure Open_Panel_0()
  If OpenWindow(0, 373, 151, 648, 439, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Panel0")
    If CreateGadgetList(WindowID())
      
      ;- Panel0
      PanelGadget(0, 18, 63, 603, 267)
      AddGadgetItem(0, -1, "Tab 1")
      DateGadget(11, 156, 146, 110, 25, "Datum: %mm/%dd/%yyyy Zeit: %hh:%ii")
      DateGadget(22, 156, 14, 110, 25, "Datum: %mm/%dd/%yyyy Zeit: %hh:%ii")
      CloseGadgetList()
      
    EndIf
  EndIf
EndProcedure

Open_Panel_0()

Repeat
  EventID = WaitWindowEvent()
  
  If EventID = #PB_EventGadget
    
    Select EventGadgetID()
      Case 0
        
    EndSelect
    
  EndIf
  
Until EventID = #PB_EventCloseWindow
  


End 

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

Post by guruk »

Thank I got it ...

I did the design with Visual Designer.. it look it does not support
Dategadget.. is this right?
jamirokwai
Enthusiast
Enthusiast
Posts: 796
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Post by jamirokwai »

guruk wrote:Thank I got it ...

I did the design with Visual Designer.. it look it does not support
Dategadget.. is this right?
I know, this is really old, but...

At the moment, it still doesn't work on Mac.
It seems to be a bug in version Mac OS X 4.20 (4.30a1 also). See
my report here: http://www.purebasic.fr/english/viewtopic.php?t=33032

A copy'n'run-Version is here:

Code: Select all

Procedure Open_Panel_0() 
  If OpenWindow(0, 373, 151, 648, 439, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar , "Panel0") 
    If CreateGadgetList(WindowID()) 
      ;- Panel0 
      PanelGadget(0, 18, 63, 603, 267) 
     ;- the following shows up
      DateGadget(11, 6, 6, 110, 25, "Datum: %mm/%dd/%yyyy Zeit: %hh:%ii") 
      AddGadgetItem(0, -1, "Tab 1")
     ;- the following does not show up...
      DateGadget(22, 6, 6, 110, 25, "Datum: %mm/%dd/%yyyy Zeit: %hh:%ii") 
      CloseGadgetList() 
    EndIf 
  EndIf 
EndProcedure 

Open_Panel_0() 

Repeat 
  EventID = WaitWindowEvent() 
  If EventID = #PB_EventGadget 
    Select EventGadgetID() 
      Case 0 
    EndSelect 
  EndIf 
Until EventID = #PB_EventCloseWindow 
End
Regards,
JamiroKwai
guruk
User
User
Posts: 50
Joined: Thu Aug 18, 2005 2:05 pm

thanks :)

Post by guruk »

yes... its quit old...

but it remembered me to code again a bit with purebasic.

thanks

greets
chris
Post Reply