mylist=xwin_createsimplewindow()
print mylist[0]


'    mylist = xwin_select_1()
    testid = mylist[0]
    mylist={}  //--free the table from memory

xwin_setwmstruts( "0x" & testid ,20,10,24,10)


shell("xterm")
end

    mylist = xwin_select_1()
    testid = mylist[0]
    mylist={}  //--free the table from memory

mylist = xwin_classinfo( "0x" & testid  )

    print mylist[0]
    mylist={}  //--free the table from memory
end


    mylist = xwin_select_1()
    testid = mylist[0]
    mylist={}  //--free the table from memory

    mylist = xwin_hastitleandborder( "0x" & testid  )

    print mylist[0]
    mylist={}  //--free the table from memory
end

    mylist = xwin_select_1()
    testid = mylist[0]
    mylist={}  //--free the table from memory
xwin_titleandborder( "0x" & testid  )


end
    mylist = xwin_select_1()
    testid = mylist[0]
    mylist={}  //--free the table from memory

xwin_setlayer( "0x" & testid ,1  )

end

    mylist = xwin_select_1()
    testid = mylist[0]
    mylist={}  //--free the table from memory

    mylist = xwin_info( "0x" & testid )

     x=  mylist[0]
     y=  mylist[1]


    mylist={}  //--free the table from memory



xwin_notitlenoborder( "0x" & testid  )

print x
print y
xwin_move( "0x" & testid , x , y )
end

mylist = xwin_select_1()
print mylist[0]

xwin_movetoworkspace( "0x" & mylist[0] , "2" )
mylist = {}
end

   'mylist = xwin_listiconidsofworkspace( 0 )
   mylist = xwin_listiconids(  )
   ' for each myline in mylist
     for i=0 to count(mylist)-1

      myline = mylist[i]
'print myline

      thespace=instr( myline , " " )
      id = left(myline, thespace)
      winname = right(myline , len(myline)-thespace)
      print "invisible: " & id & "Desktop: " & winname
    next
'wxmessagebox(count(mylist))
    mylist={}  //--free the table from memory

end
mylist = xwin_getworkspaces()
print mylist[0]
last= mylist[0] -1
mylist = {}
'wxmessagebox( last )

'end

xwin_setworkspace(last)
end

mylist = xwin_getworkspace()
print mylist[0]
mylist = {}
end



mylist = xwin_screensize()
print mylist[0]
print mylist[1]
mylist = {}
end

// select window with mousebutton1
// returns "END" if button3 is pressed

mylist = xwin_select_1()
print mylist
mylist = {}
end

// select several windows
// stops with button 3
mylist = xwin_multiselect()
print mylist
mylist = {}
end


    //-----------------------------------------------------------
   // --    list all iconified windiows of current desktop    --
   mylist = xwin_listicons(  )

    for each myline in mylist
      thespace=instr( myline , " " )
      id = left(myline, thespace)
      winname = right(myline , len(myline)-thespace)
      print "invisible: " & id & "Desktop: " & winname
    next

    mylist={}  //--free the table from memory


    //-------------------------------------------------------------
   // --  find out, which windows there are on our desktop --
   mylist = xwin_listwindows(  )

    for each myline in mylist
      thespace=instr( myline , " " )
      id = left(myline, thespace)
      winname = right(myline , len(myline)-thespace)
      print "visible: " & id & " " & winname
    next

    mylist={}  //--free the table from memory


 //---------------------------------------------------
//  select a window with the mouse

print "\n\n-----------------------------------------------"
print "PLEASE SELECT A WINDOW"
print "-----------------------------------------------"
mylist = xwin_select()
testid = "0x" & mylist[0]
mylist={}  //--free the table from memory


 //--------------------------------------------
// -- now some standard-XWIN-functions

print "--testing--"
print "using ID " & testid

     //--------------------------------
    //  get some more detailed info
    mylist = xwin_info( testid )

     print "x: " & mylist[0]
     print "y: " & mylist[1]
     print "width: " & mylist[2]
     print "height: " & mylist[3]
     print "state: " & mylist[4]  //-- 2: visible - 0: iconified

    mylist={}  //--free the table from memory


    xwin_activate( testid )
    xwin_resize( testid , 100 , 500)
    xwin_move( testid , 100 , 100)
    xwin_activate( testid )


     print "\n\n-----------------------------------------------"
     print "WINDOW WAS MOVED AND RESIZED"
     print "PLEASE CLICK THE MOUSE TO ICONIFY THE WINDOW"
     print "-----------------------------------------------"
    shell("xmessage \"                continue               \"")

    xwin_iconify( testid )


     print "\n\n-----------------------------------------------"
     print "WINDOW WAS ICONIFIED"
     print "PLEASE CLICK THE MOUSE TO RESTORE THE WINDOW"
     print "-----------------------------------------------"
    shell("xmessage \"                continue               \"")


    xwin_activate( testid )
    xwin_move( testid , 700 , 100)
    xwin_resize( testid , 400 , 300)
    xwin_activate( testid )

print "--done testing--"

end

 //--------------------------
//-- test memory-usage --
for i=0 to 1000000

   //--return values in a table
   mylist = xwin_listicons(  )

  'print "0: " & mylist[0]
  'print "1: " & mylist[1]

    mylist={}  //--free the table from memory

next


