Page 1 of 1
Panel Gadget & Dategadget together does not work ?!!!
Posted: Fri Oct 21, 2005 4:29 pm
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
Posted: Fri Oct 21, 2005 4:31 pm
by Trond
Because you create it behind the panel so that all clicks are stopped by the panel. You must remove CloseGadgetList().
Posted: Fri Oct 21, 2005 4:31 pm
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
Posted: Fri Oct 21, 2005 4:41 pm
by guruk
Thank I got it ...
I did the design with Visual Designer.. it look it does not support
Dategadget.. is this right?
Posted: Thu Jun 26, 2008 8:02 pm
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
thanks :)
Posted: Fri Jun 27, 2008 10:12 am
by guruk
yes... its quit old...
but it remembered me to code again a bit with purebasic.
thanks
greets
chris