#!/usr/bin/gtkbasic002

HERE = xwin_getdir(command(2))
xwin_cd(HERE)


//-- load  file and show the window
gins_glade("demos.glade")
gins_main()


//-- manipulate a widget, e.g. move the window
gins_set("window1" , "10" , "30" , "<uposition>")


//-- mainloop with eventhandling
while 1

  widget , event , pdata = gins_event()

  if widget != Nothing then
  '  print widget
  '  print event
  '  print pdata

    if event = "GDK_DELETE" then
      gins_exit()
      end
    end if

    if event = "GDK_BUTTON_RELEASE"  then
   ' print widget
   ' print event
   ' print pdata

      if widget = "button1" then
        shell(HERE & "/calc &")
      end if
      if widget = "button2" then
        shell(HERE & "/multifilechooser-demo &")
      end if
      if widget = "button3" then
        shell(HERE & "/Grabpics/grabpics &")
      end if
      if widget = "button4" then
        shell(HERE & "/GtkBasicIde/start-GtkBasicIde &")
      end if
      if widget = "button5" then
        shell(HERE & "/Clist1/testlists &")
      end if

    end if
  end if

  xwin_usleep(10000)

wend
