Page 1 of 1

No events from the CalendarGadget

Posted: Sun May 06, 2007 7:23 am
by Beach
I am unable to get events from the CalendarGadget. Anyone else having trouble with them? Here is an example:

Code: Select all

OpenWindow(0, 400, 160, 300, 275, "Calendar", #PB_Window_SystemMenu)
If CreateGadgetList(WindowID(0))
  Calendar = CalendarGadget(#PB_Any, 25, 10, 245, 200)
  DateStr = StringGadget(#PB_Any, 25, 230, 240, 30, "")
EndIf

;-this works
CurrentDate$ = FormatDate("%yyyy-%mm-%dd",GetGadgetState(Calendar))
SetGadgetText(DateStr,CurrentDate$)

Repeat
  Event = WaitWindowEvent()
  Select Event
    
    Case #PB_Event_CloseWindow
        Break
      
    Case #PB_Event_Gadget 
      If EventGadget() = Calendar
        ;-does nothing
        NewDate$ = FormatDate("%yyyy-%mm-%dd",GetGadgetState(Calendar))
        SetGadgetText(DateStr,NewDate$)
      EndIf
      
  EndSelect
  
ForEver

Posted: Sun May 06, 2007 9:47 am
by milan1612
EDIT: My failure...removed

Posted: Sun May 06, 2007 3:16 pm
by Beach
I was afraid this would be the answer. I'm not sure why mine is not responding then. I am running Ubuntu 7.04 with all the required libs. What distro are you working with?

Also, does SetGadgetColor work with your calendar?

Code: Select all

SetGadgetColor(Calendar,#PB_Gadget_TitleBackColor,$000000)
SetGadgetColor(Calendar,#PB_Gadget_TitleFrontColor,$0000FF)

Posted: Sun May 06, 2007 4:25 pm
by Beach
I just tried this example on Ubuntu 6.10 and I have the same issue. I am willing to try anything at this point.

Posted: Sun May 06, 2007 4:27 pm
by milan1612
Oh shit, I forgot being in the "Linux"-Forum.
I'm so sorry, I tested on Windows :oops:
Shame on me...

Posted: Sun May 06, 2007 8:39 pm
by Beach
Posted in the "Bug Reports" forum. I hope it can be resolved, its all that is standing in the way of a pretty cool wallpaper changer for Gnome.

Posted: Sun May 06, 2007 10:26 pm
by bembulak
confirmed. It does not fire an event. Strange, because I've used the calender-gadget successfully in beta(1)-stage.

See here:
http://www.purebasic.fr/english/viewtop ... ight=pinda
http://www.purearea.net/pb/showcase/sho ... 1fa99ad42b

edit: Xubuntu Feisty Fawn 7.04

Posted: Mon May 07, 2007 10:00 am
by oryaaaaa
I post reply bug-forum.

CalendarGadget=GtkCalendar

Code: Select all

GObject
   +----GtkObject
         +----GtkWidget
               +----GtkCalendar
But PB dont get ALL EVENT
"day-selected" signal is no sensor.
GtkCalendar dont use "clicked" signal.

This is PB BUG.