GLX Application FrameworkGLX Application Framework 1.2 Configuring Your ApplicationHow Can I Notify My Application That The Value For A Preference Has Been Changed?

How Can I Notify My Application That The Value For A Preference Has Been Changed?

The GLX framework can broadcast messages when a preference value is changed.

Add Preference

If the preference does not already exist in the list of preferences (1) then you will need to add it.

Adding a Preference

1) Click on the Add Preference button.

2) Enter the name of the preference.

3) Click OK.

Note: You only need to add preferences that you want to a) enter a default value for and/or b) broadcast a message for when the value is changed.

Adding a Message To Broadcast

First you enter the object to send the message to.

1) Click on Add Message.

2) Enter an object reference.

3) Click OK.

Next you enter the message to send to the object.

1) Enter the message name.

2) Press OK.

Handling the Message

on PreferenceUpdated pPreference
   switch pPreference
      case "sort list by"
         SortListFieldBy glxapp_getPref(pPreference)
         break             
   end switch
end PreferenceUpdated

You now need to handle the message that is broadcast to the object (or elsewhere in the message path). Add a message with the same name you entered previously and define a single parameter which will be the name of the preference.

0 Comments

Add your comment

E-Mail me when someone replies to this comment