#!/usr/bin/gtkbasic003


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


//-- test new objectstuff

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

//--- add a list
gtk_createobject("GtkBasicList" , "mylist1", "window1" , "scrolledwindow1")
gtk("gtk_widget_show" , "mylist1" , 0 ,0,0,0,0)

	gtk("gtk_clist_set_column_title", "mylist1" , "0" , "this is a list", 0,0,0)


	gtk("gtk_clist_append", "mylist1" , "" ,0,0,0,0)
	//gtk("gtk_clist_set_text", "mylist1" , "0" , "0", "listentry" & " 1",0,0)


//-- create a completely new window

gtk_createobject("GtkWindow" , "NewWindow", 0 , 0)
gtk("gtk_widget_show" , "NewWindow" , 0 ,0,0,0,0)
gtk("gtk_hbox_new" , "0" , "0" ,0,0,0,0)
gtk_setobjectname("NewHBox")
gtk("gtk_container_add" , "NewWindow" , "NewHBox"  , "1","1","0",0 )
gtk("gtk_widget_show" , "NewHBox" , 0 ,0,0,0,0)


//--- pixmap
gtk_createobject("PixmapwidFromFile" , "pixmap1", "cone.xpm" , 0)
gtk("gtk_box_pack_start" , "NewHBox" , "pixmap1" , "1","1","0",0)
gtk("gtk_widget_show" , "pixmap1" , 0 ,0,0,0,0)

gtk_createobject("PixmapwidFromFile" , "pixmap3", "cube.xpm" , 0)
gtk("gtk_pixmap_get" , "pixmap3" , "gdkpixmap3" ,"gdkmask3",0,0,0)
gtk("gtk_pixmap_new" , "gdkpixmap3" , "gdkmask3" ,0,0,0,0)
gtk_setobjectname("pixmap4")
gtk("gtk_box_pack_start" , "NewHBox" , "pixmap4" , "1","1","0",0)
gtk("gtk_widget_show" , "pixmap4" , 0 ,0,0,0,0)

gtk_createobject("PixmapwidFromFile" , "pixmap5", "sphere.xpm" , 0)
gtk("gtk_pixmap_get" , "pixmap5" , "gdkpixmap5" ,"gdkmask5",0,0,0)
gtk("gtk_pixmap_new" , "gdkpixmap5" , "gdkmask5" ,0,0,0,0)
gtk("gtk_box_pack_start" , "NewHBox" , "pixmap5" , "1","1","0",0)
gtk("gtk_widget_show" , "pixmap5" , 0 ,0,0,0,0)

gtk_destroyobject("button1")
gtk_destroyobject("pixmap5")
gtk_destroyobject("pixmap1")

//gtk_createobject("GdkPixmap" , "pixmap1", 0 , 0)
'gtk_get_pixmap_and_mask("pixmap1", "gdkpixmap1" , "gdkmask1" )

//gtk( "gtk_clist_set_pixmap" , "mylist1" , "0" ,"0","gdkpixmap1","gdkmask1",0) 

'gtk_clist_set_pixtext(  "mylist1" , "0" ,"0","test","2","gdkpixmap1","gdkmask1") 

//gtk("gtk_clist_get_text", "mylist1" , "0" , "0" , 0,0,0)
//a = gtk_returntext("3")

'gtk_clist_get_pixtext( "mylist1" , "0" , "0")
'a = gtk_returntext("3")
'print a

'gtk_createobject("PixmapwidFromFile" , "pixmap2", "cube.xpm" , 0)
'gtk_get_pixmap_and_mask("pixmap2", "gdkpixmap2" , "gdkmask2" )
'gtk("gtk_clist_append", "mylist1" , "" ,0,0,0,0)
'gtk_clist_set_pixtext(  "mylist1" , "1" ,"0","test2","20","gdkpixmap2","gdkmask2") 


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

//gtk_destroyobject("mylist1")

'gtk_destroyobject("pixmap2")
'gtk_destroyobject("gdkpixmap2")
'gtk_destroyobject("gdkmask2")

'gtk_destroyobject("button2")

//-- 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 , widget, pdata
   ' 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
