#!/usr/bin/gtkbasic002


//-- load  file and show the window
gins_glade("test.glade")
gins_set("window1" , "300" , "100" , "<uposition>")
gins_main()


//-- test new objectstuff

//-- add new elements to a window made with glade

gtk_createobject("GtkButtonWithLabel" , "button96", "testbutton" , 0)
gtk("gtk_box_pack_start" , "vbox1" , ":button96" , "0","0","0",0)
gtk("gtk_widget_show" , ":button96" , 0 ,0,0,0,0)

gtk_createobject("GtkLabel" , "label77", "testlabel" , 0)
gtk("gtk_box_pack_start" , "vbox1" , ":label77" , "0","0","0",0)
gtk("gtk_widget_show" , ":label77" , 0 ,0,0,0,0)


//-- create a completely new window

gtk_createobject("GtkWindow" , "NewWindow", 0 , 0)
gtk("gtk_widget_show" , ":NewWindow" , 0 ,0,0,0,0)
gtk_createobject("GtkHBox" , "NewHBox", "0" , "0")
gtk("gtk_container_add" , ":NewWindow" , ":NewHBox"  , "1","1","0",0 )
gtk("gtk_widget_show" , ":NewHBox" , 0 ,0,0,0,0)

gtk_createobject("GtkButtonWithLabel" , "button77", "wwwbutton" , 0)
gtk("gtk_box_pack_start" , ":NewHBox" , ":button77" , "1","1","0",0)
gtk("gtk_widget_show" , ":button77" , 0 ,0,0,0,0)
gtk("gtk_button_set_label" , ":button77" , "bbb" ,0,0,0,0)

//gtk("gtk_window_resize" ,"window1" ,  "100" , "100", 0,0,0)




//-- mainloop with eventhandling
while 1

  widget , event , pdata = gins_event()

  if widget != Nothing then
   //-- uncomment these lines to see ALL events in the console
    print widget
    print event
    print pdata

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

    if event = "GDK_BUTTON_RELEASE" or event = "GDK_BUTTON_PRESS" then

      //-- example how to switch on/off attributes of a widget

      if widget = "button1" then


gtk("gtk_box_reorder_child" , "vbox1" , ":button1" , "1" ,0,0,0)

      end if




    end if

  end if

  gins_usleep(10000)

wend
