August 6, 2008

How to Warn Users Before Their Browser Closes

Suppose a user enters some information on the page and tries to close or navigate from the window?without saving the data. You may want to warn the user about possible data loss. To do this, use the window DOM object’s onbeforeunload event, which is fired just before the unload event.

The Basics of REALbasic, Cross-platform RAD Tool in the Mold of VB

n recent years, the move towards web-based applications has accelerated for a variety of reasons, including the need for simple and reliable installations. Despite the many reasons for developing web applications, an old-fashioned, double-clickable native application is still better at some things. The user experience, for example, is generally richer

Resize a Form to the Working Area on the Desktop

The code below demonstrates how to resize a form to the working area on the desktop using GetScreenRect. Private Sub frmFullScreen_Load _ (ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles MyBase.Load Me.Location = My.Computer.Screen.WorkingArea.Location Me.Size = My.Computer.Screen.WorkingArea.Size ‘and maybe place an “exit” button to the bottom right corner

Create a Menu Bar with JavaFX

Here’s a JavaFX example that creates a nice menu bar. All you need is a set of images named: home_1.bmp (unpressed), home_2.bmp (pressed), news_1.bmp, news_2.bmp,contact_1.bmp, contact_2.bmp, photos_1.bmp and photos_2.bmp: import javafx.ui.*;import javafx.ui.canvas.*;import javafx.ui.filter.*;import java.lang.System;class NiceMenu extends CompositeNode{attribute home: String;attribute news: String;attribute contact: String;attribute photos: String;}attribute NiceMenu.home = “.//images//home_1.bmp”;attribute =

What Is the Smallest Object Size Possible in C/C++?

Q: What is the smallest object size possible in C/C++? A: A first attempt to create a size 0 object may look like this: class Empty {}; However, the value of sizeof(Empty) will always be greater than zero (it is usually 1). This actually makes sense; otherwise it would be