[Resolved] CreateToolBar(0, WindowID())

Mac OSX specific forum
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

[Resolved] CreateToolBar(0, WindowID())

Post by garretthylltun »

I can't get the CreateToolBar(0, WindowID()) working. Is there
something special we have to do to get it working in OSX? Or does
it just not work in OSX yet?

Thanks,
-Garrett
Last edited by garretthylltun on Tue Jan 17, 2006 2:27 am, edited 2 times in total.
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

WindowID ???

Code: Select all

 If CreateToolBar(0, WindowID(#Main_Window))
    ToolBarImageButton(0, UseImage(TBico_1))
    ToolBarImageButton(1, UseImage(TBico_2))
    ToolBarImageButton(2, UseImage(TBico_3))
    
    ToolBarSeparator()

    ToolBarImageButton(3, UseImage(TBIco_4))
    ToolBarToolTip(3, "Print")
    
    ToolBarImageButton(4, UseImage(TBico_5))
    ToolBarToolTip(4, "Find a document")
    
    
    ; Trying to Create and Toolbar Item that NOT have an Menu Item
    ToolBarSeparator()
    ToolBarImageButton(100,UseImage(TBico_6))
   EndIf ; Create Toolbar
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

Post by garretthylltun »

Sheesh! I missed putting the window id in the encapsulation of the
syntax. :roll:

Thank you :-)
-Garrett
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

Post by garretthylltun »

Ok, I am obviously missing something here and I can't find my problem.

Could someone take a looksie and see if they can find my mistake?

Code: Select all

OpenWindow (0, 100, 100, 400, 300, #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered , "Test Window")
UsePNGImageDecoder()
LoadImage(0, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/new16.png")
;LoadImage(1, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/open16.png")
;LoadImage(2, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/save16.png")
;LoadImage(3, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/saveas16.png")
;LoadImage(4, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/cut16.png")
;LoadImage(5, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/copy16.png")
;LoadImage(6, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/paste16.png")
;LoadImage(7, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/undo16.png")
;LoadImage(8, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/hlp16.png")
;LoadImage(9, "/Users/garrett/Documents/Development/PureBasicProjects/TestProgram/close16.png")
CreateToolBar(0, WindowID())
ToolBarStandardButton(0, UseImage(0))
ToolBarStandardButton(1, #PB_ToolBarIcon_Open)
CreateGadgetList(WindowID())
;ButtonImageGadget(9, 320, 5, 29, 30, UseImage(9))
;ButtonImageGadget(8, 285, 5, 29, 30, UseImage(8))
;ButtonImageGadget(7, 250, 5, 29, 30, UseImage(7))
;ButtonImageGadget(6, 215, 5, 29, 30, UseImage(6))
;ButtonImageGadget(5, 180, 5, 29, 30, UseImage(5))
;ButtonImageGadget(4, 145, 5, 29, 30, UseImage(4))
;ButtonImageGadget(3, 110, 5, 29, 30, UseImage(3))
;ButtonImageGadget(2,  75, 5, 29, 30, UseImage(2))
;ButtonImageGadget(1,  40, 5, 29, 30, UseImage(1))
;ButtonImageGadget(0,   5, 5, 29, 30, UseImage(0))

EditorGadget(3, 5, 40, 390, 255) 
EventID = WaitWindowEvent()
Event_Loop:
  EventID = WaitWindowEvent()
  If EventID = #PB_Event_CloseWindow  ; If the user has pressed on the close button
    End
  EndIf
  GadgetID = EventGadgetID()
  If GadgetID = 9
    Goto Gadget_Branch_9
  EndIf
  Goto Event_Loop

Gadget_Branch_9:
  End
Toolbar just isn't showing up at all for me :-(

-Garrett
garretthylltun
Enthusiast
Enthusiast
Posts: 346
Joined: Wed Oct 26, 2005 2:46 am
Contact:

Post by garretthylltun »

Disregard... It's working now.

Thanks for the help though :-)
-Garrett
Post Reply