Facebook Messenger Tutorial
From Xojo Documentation
Creating apps with Xojo is quick and easy! We recently saw a video on Gizmodo where someone built a Windows-only Facebook messenger app in 3 minutes. Watch how we use Xojo to build the same app for Windows, Mac and Linux in less than 60 seconds. Then learn how you can do it too! As a bonus, we'll also show you how to build the same app for iOS using Xojo in about a minute.
Making the App
Here's how to do it:
- Launch Xojo (download it for free).
- In the Project Chooser, select “Desktop” if it’s not already selected.
- In the Application Name field, type “Messenger” and click the OK button.
- Since you don’t have icons, skip the step of assigning an app icon.
- Move your mouse over the pane of controls on the right side of the window (this is called the control Library) and drag the HTMLViewer control to the window in the center of the screen. It's under "Viewers":
- Position the HTMLViewer control in the upper-left corner of the window.
- In the toolbar, click the Fill Width button to make the HTMLViewer as wide as the window.
- In the toolbar, click the Fill Height button to make the HTMLViewer as tall as the window.
- Click the blue Inspector button in the upper-right corner of Xojo’s main toolbar to show the property Inspector.
- In the Behavior section of the Inspector pane, change "Native" to “WebKit” from the Renderer popup menu.
- In the Locking section of the Inspector pane, click on the right lock and the bottom lock (the two unlocked icons) to lock the right and bottom edges of the HTMLViewer to the window. This will make it resize when the user resizes the window.
- Double-click on the HTMLViewer control in the window to add an event.
- In the Add Event Handler dialog box, select Open in the list and then click the OK button.
- You are now in the Code Editor. Click in the Code Editor to put the cursor there. Enter the following code exactly as you see it (including the quotes):Me.LoadURL("https://messenger.com")
- In the left-hand pane, click on Window1 to select it.
- In the Inspector pane on the right, find the Frame section and click in the Title field.
- Enter “Messenger” (without the quotes) as the title.
- Click the green Run button in Xojo's main toolbar to test out your application.
- Enter your Facebook login information and you can start to chat away with your friends.