[gtk-server] Calendar Widget

  • From: "Bill Christiansen" <bill.christiansen@xxxxxxxxx>
  • To: gtk-server@xxxxxxxxxxxxx
  • Date: Sun, 8 Apr 2007 16:40:22 +1200

Hi,
I'm not a very experienced programmer but just giving the Gtk-server, BASH,
Glade combination a try.

The GUI I made in Glade has a calendar widget and I can retrieve it's widget
ID and access it's day_clicked event:

# Get calendar widget ID and connect signal
gtk "gtk_server_glade_widget calendar1"
calendar1_ID=$RESULT
gtk "gtk_server_connect $calendar1_ID day-selected calendar_clicked"

But when I try to use get_date I am getting "-1" returned:

# Initialize EVENT variable
EVENT=0

# Mainloop
while [[ $EVENT != "main_window" && $EVENT != "button_exit" ]]
do
   gtk "gtk_server_callback WAIT"
   EVENT=$RESULT

   if [[ $EVENT = "calendar_clicked" ]]
   then
       gtk "gtk_calendar_get_date $calendar1_ID"

       text="'$RESULT'"
       echo $text  # this is printing "-1" on console

   fi
done

It may be that I need to process the $RESULT more as the GTK docs say it
returns a tuplet of three integers for year month day, but may BASH knowlege
is also limited at this stage, or is it because the calendar widget needs to
be setup in the gtk-server.cfg to be usable. Anyone else have experience
with this widget?

Regards
Bill

Other related posts: