PureBasic Forum
http://forums.purebasic.com/english/

[Done] [All PB vers, gtk2/gtk3] colored parts issue
http://forums.purebasic.com/english/viewtopic.php?f=37&t=69509
Page 1 of 1

Author:  Oma [ Sat Oct 28, 2017 5:46 am ]
Post subject:  [Done] [All PB vers, gtk2/gtk3] colored parts issue

As with the CalendarGadget() i haven't seen no distribution or theme where setting colors for the calendar parts of the DateGadget() with SetGadgetColor(#Gadget, ColorType, Color) would really recolor something.
Since it is hardly possible to make the function work reliably under all Linux, a remark in the help would be good, like "Works only if supported". See also the Help ("not supported on Windows Vista+").
Code:
#Win_Main = 0

#DtG     = 0

Global.i gEvent, gQuit

Procedure Create_WinMain()
   If OpenWindow(#Win_Main, 300, 200, 400, 300, "DateGadget colored parts", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
      DateGadget    (#DtG,     5,   5, 200,  26, "%yyyy-%mm-%dd %hh:%mm:%ss", Date(2010, 06, 01, 12, 00, 00), #PB_Date_CheckBox)
      
      SetGadgetColor (#DtG, #PB_Gadget_BackColor,       $C0FFFF)
      SetGadgetColor (#DtG, #PB_Gadget_TitleBackColor,  $FFFFC0)
      SetGadgetColor (#DtG, #PB_Gadget_FrontColor,      $FF0000)
      SetGadgetColor (#DtG, #PB_Gadget_TitleFrontColor, $00FF00)
      SetGadgetColor (#DtG, #PB_Gadget_GrayTextColor,   $0000FF)
      
   EndIf
EndProcedure

Create_WinMain()

Repeat
   gEvent= WaitWindowEvent()
   
   Select gEvent
      Case #PB_Event_CloseWindow
         gQuit= #True
         
   EndSelect
   
Until gQuit
Regards, Charly

Author:  freak [ Sat Oct 28, 2017 3:12 pm ]
Post subject:  Re: [All PB vers, gtk2/gtk3] DateGadget: colored parts issue

These options are not implemented for Gtk. The docs need to be updated.

Author:  Oma [ Sun Oct 29, 2017 7:49 am ]
Post subject:  Re: [All PB vers, gtk2/gtk3] DateGadget: colored parts issue

Since the color issue concerns a lot of gadgets under Linux, it might be helpful to add a note in the help-file for
SetGadgetColor(#Gadget, ColorType, Color) (or GetGadgetColor(), SetGadgetItemColor(), GetGadgetItemColor() too)
for Linux newbies like:
"Works if supported by distribution, window manager and theme"!

It could prevent a lot of fruitless bug reports from newcomers.

Author:  Andre [ Tue Feb 06, 2018 11:07 pm ]
Post subject:  Re: [All PB vers, gtk2/gtk3] DateGadget: colored parts issue

I just added a Linux-specific note at SetGadgetColor() and SetGadgetItemColor() like suggested by Oma. Thanks!

@Fred/freak: if that is enough, this topic can be closed as 'Done' :D

Author:  Mesa [ Tue Dec 11, 2018 6:23 pm ]
Post subject:  Re: [All PB vers, gtk2/gtk3] DateGadget: colored parts issue

Some words has been added about gtk as Freak noticed it.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/