to test most of the examples in the manual.... starting with the "gadget" section
The examples here are not working for me, because I forget something
or simply they dont work.... Im comparing with the windows version.
I have all the flags on : enable debuger, asm support, create unicode executable
create threadsafe executable
Using Ubuntu 6.10, PB 4 beta 2
+++ With Problems +++
Code: Select all
 If OpenWindow(0, 0, 0, 120, 100, "ButtonImage", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
    If LoadImage(0, "/home/chen/pb/pbcomm/Images/PBIDE.bmp")    ; change 2nd parameter to the path/filename of your image
      ButtonImageGadget(0, 10, 10, 100, 83, ImageID(0))
    EndIf
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf- does not work with ".ico" images
..........
+++ Working... +++
Code: Select all
 If OpenWindow(0, 0, 0, 200, 250, "DateGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    If CreateGadgetList(WindowID(0))
      DateGadget(0, 10, 10, 180, 25, "Date: %mm/%dd/%yyyy Time: %hh:%ii")
      Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
    EndIf
  EndIf++++ Update: is working... ++++ I installed again Ubuntu.
..........
+++ Works adding chr(10) an the end of line. see next post by Walker+++
Code: Select all
 If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) 
    EditorGadget(0, 8, 8, 306, 133) 
    For a = 0 To 5 
      AddGadgetItem(0, a, "Line "+Str(a)) 
    Next 
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow 
  EndIf the AddGadgetItem is not working in "Editor Gadget"... it works in "ListviewGadget"
..........
+++ works if *.* is replaced by /*.* as Walker point out +++
Code: Select all
 If OpenWindow(0, 0, 0, 400, 200, "ExplorerListGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
    ExplorerListGadget(0, 10, 10, 380, 180, "*.*", #PB_Explorer_MultiSelect)
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf - open window but empty.....
..........
+++ With Problems +++
Code: Select all
 If OpenWindow(0, 0, 0, 320, 250, "Frame3DGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    CreateGadgetList(WindowID(0))
      Frame3DGadget(0, 10,  10, 300, 50, "Frame3DGadget Standard")
      Frame3DGadget(1, 10,  70, 300, 50, "", #PB_Frame3D_Single)
      Frame3DGadget(2, 10, 130, 300, 50, "", #PB_Frame3D_Double)
      Frame3DGadget(3, 10, 190, 300, 50, "", #PB_Frame3D_Flat)
    
    Repeat
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf 
 I dont know if it is the theme Im using.
..........
+++ With Problems +++
Code: Select all
 If OpenWindow(0, 0, 0, 270, 160, "HyperlinkGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
    HyperLinkGadget(0, 10, 10, 250,20,"Red HyperLink", RGB(255,0,0))
    HyperLinkGadget(1, 10, 30, 250,20,"Arial Underlined Green HyperLink", RGB(0,255,0), #PB_HyperLink_Underline)
    SetGadgetFont(1, LoadFont(0, "Arial", 12))
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf..........
+++ With Problems +++
Code: Select all
 If OpenWindow(0, 0, 0, 245, 105, "ImageGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
    If LoadImage(0, "/home/chen/pb/pbcomm/Images/PBIDE.bmp")    ; change 2nd parameter to the path/filename of your image
      ImageGadget(0,  10, 10, 100, 83, ImageID(0))                      ; imagegadget standard
      ImageGadget(1, 130, 10, 100, 83, ImageID(0), #PB_Image_Border)     ; imagegadget with border
    EndIf
    Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf..........
To no post all examples with images.... only a note:
- I must unchecked "create unicode executable" from compiler options fpr work
..........
+++ With Problems ++
Code: Select all
#Main = 0
  #MDIChild = 1
  If OpenWindow(#Main, 0, 0, 400, 300, "MDIGadget", #PB_Window_SystemMenu|#PB_Window_ScreenCentered|#PB_Window_SizeGadget|#PB_Window_MaximizeGadget)
    If CreateGadgetList(WindowID(#Main)) And CreateMenu(#Main, WindowID(#Main))
      MenuTitle("Menu index 0")
      MenuTitle("MDI windows menu")
        MenuItem(0, "self created item")
        MenuItem(1, "self created item")
        
      MDIGadget(0, 0, 0, 0, 0, 1, 2, #PB_MDI_AutoSize)
        AddGadgetItem(0, #MDIChild, "child window")
        CreateGadgetList(WindowID(#MDIChild))
          ; add gadgets here...
      UseGadgetList(WindowID(#Main)) ; go back to the main window gadgetlist
    EndIf
    Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
  EndIf..........
+++ working see how in the next post by Walker +++
Code: Select all
If OpenWindow(0, 0, 0, 600, 300, "WebGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
    WebGadget(0, 10, 10, 580, 280, "http://www.purebasic.com")
    ; Note: if you want to use a local file, change last parameter to "file://" + path + filename
    Repeat 
    Until WaitWindowEvent() = #PB_Event_CloseWindow
  EndIf- mozilla embeding library not found. Call WebGadgetPath() first
- I couldnt find library "libgtkembedmoz.so"
.......... Thats all for the Gadget Section......





