<<<<<<<<<<<<<<<<<

motif(motif) Motif Widgets motif(motif)

NAME

motif - motif user interface

DESCRIPTION

Motif is a user interface class that implements the Open Software Foundation's motif toolkit. This class serves both as an object and a supporting superclass for the motif widgets.

As a class, motif can be a parent to any top level widget in a user interface. It also controls the processing of the event loop.

SUPERCLASS

xt

INSTANCE VARIABLES

drag_convert_proc is the name of a LYMB procedure that is used to retrieve drag information when the widget is a drag source. It is called once for each item that is being transferred in the drag.

This procedure has two string in_args, These arguments will supplied to the procedure when a drag is initiated. The first holds the name of the drag source widget. The second holds the name of the atom type of the data being transferred. Possible atom types include PIXMAP and COMPOUND_TEXT (see list below.)

This procedure also has one ref_arg which holds the name of a LYMB instance that the data will be assigned to. The class of this instance depends on the atom type of the data. For example, this argument would be an xpixmap for PIXMAP data or a string for COMPOUND_TEXT data.

drop_transfer_proc is the name of a LYMB procedure that is used to receive and process drop information when the widget is a drop site. It is called once for each item that is being transferred in the drop.

This procedure has two string in_args, These arguments will supplied to the procedure when a drag is initiated. The first holds the name of the drop site widget. The second holds the name of the atom type of the data being transferred. Possible values include COMPOUND_TEXT and PIXMAP (see list below.)

This procedure also has one ref_arg which holds the name of a LYMB instance that holds the data. The class of this instance depends on the atom type of

the data. For example, this argument would be an xpixmap for PIXMAP data or a string for COMPOUND_TEXT data. You must copy this data if you plan to use it after the drop_transfer_proc. (The data is not guaranteed to hang around!)

MESSAGES

add_tab_group! add the widget to the list of tab groups for the application.

change_color:pixel changes the background color to the pixel value, recalculates the assiciated colors (shadow, select, foreground etc.) and updates respective resources.

get_tab_group! retrieves the id (pointer) of the tab group for the widget.

is_traversable? returns 1 if teh widget is traversable, otherwise 0.

motif_display_id? returns the pointer to the Motif display for the widget. Note that this is different than an X display pointer. See motif_display for more details.

motif_screen_id? returns the pointer to the Motif screen for the widget. Note that this is different than an X screen pointer. See motif_screen for more details.

remove_tab_group! remove the widget from the list of tab groups for the application.

update_display! refreshes the display. Similar to the flush! message of the xdisplay class, but is issued through the Motif widget layer. Motif widgets are not updated until all callbacks have been completed, so a long-running action can send an update_display! message before doing its thing, causing the display to be updated before the action.

version? returns the Motif version number (XmVersion). The major and minor versions are encoded in the returned number by multiplying the major version by 1000 and adding the minor version.

visibility? returns XmVISIBILITY_UNOBSCURED (0), XmVISIBILITY_PARTIALLY_OBSCURED (1) or XmVISIBILITY_FULLY_OBSCURED (2).

DRAG AND DROP MESSAGES

drag_convert_proc[=,?] sets or retrieves the drag_convert_proc instance variable.

drag_export_targets=atom_type_names tells the drag source which atom types can be dragged out of it using drag and drop. Possible atom types include PIXMAP, COMPOUND_TEXT, BITMAP, WINDOW, COLORMAP, FOREGROUND, BACKGROUND, and PIXEL.

drag_off! turns off drag so that the middle mouse button no longer initiates drag and drop. This can be used to disable widgets that have been enabled using the drag_on! message and widgets that are drag sources by default in Motif (text, buttons, labels and lists.)

drag_on! configures the instance to be a drag source. Middle mouse button presses in the sensitive area of the widget will then initiate drag and drops. This message must be sent after the create! message.

Any widget can be a drag source. However, text, buttons, labels and lists are automatically drag sourcesin Motif. If you want to use the default drag behavoir for these widgets, you do not need to send this message. However, if you want to override the default Motif drag behavoir so you can use the LYMB convert procedure, send the drag_off! message and then the drag_on! message.

drop_import_targets=atom_type_names tells the drop site which atom types can be dropped into it using drag and drop. Possible atom types include PIXMAP, COMPOUND_TEXT, BITMAP, WINDOW, COLORMAP, FOREGROUND, BACKGROUND, and PIXEL.

drop_on! registers the widget as a drop site. This message must be sent after the create! message.

Any widget can be a drop site. However, text and text fields are automatically drop sites in Motif. If you want to override the Motif defaults, you'll need to unregister them using drop_unregister! or drop_off!

and then turn them on again using drop_on! or drop_register! Then the drop_transfer_proc will be used to process the drops.

drop_off! unregisters a widget so it is no longer a drop site. This message can be used to disable drop sites that were registered using drop_on! or drop_register! or widgets that were drop sites by default (text and text fields) in Motif.

drop_register! is an alias for drop_on!

drop_transfer_proc[=,?] sets or retrieves the drop_transfer_proc instance variable.

drop_update! updates the drop site resources. Mainly used internally in response to of other drop messages.

drop_unregister! is an alias for drop_off!

DRAG AND DROP ATOM TYPES

The following is a list of supported atom types in motif's implementation of drag and drop and the corresponding LYMB classes that hold the transfer data: atom name LYMB class COMPOUND_TEXT string PIXMAP xpixmap (holds id) BITMAP xbitmap (holds id) COLORMAP xcolormap (holds id) FOREGROUND scalar (holds pixel value) BACKGROUND scalar (holds pixel value) PIXEL scalar (holds pixel value)

EXAMPLE

There are numerous sample scripts in scripts/motif. The script periodic.scr shows how to use most widgets.

The drag and drop examples are in scripts/motif/dnd.

SEE ALSO

motif_color motif_gadget motif_arrow_button_gadget motif_label_gadget motif_cascade_button_gadget motif_toggle_button_gadget motif_push_button_gadget motif_separator_gadget motif_manager motif_bulletin_board motif_form motif_form_dialog motif_message_box motif_message_dialog motif_error_dialog motif_information_dialog motif_question_dialog

motif_warning_dialog motif_working_dialog motif_selection_box motif_command motif_file_selection_box motif_prompt_dialog motif_selection_dialog motif_file_selection_dialog motif_drawing_area motif_frame motif_menu_bar motif_option_menu motif_paned_window motif_popup_menu motif_radio_box motif_row_column motif_pulldown_menu motif_table motif_scale motif_scrolled_window motif_main_window motif_mouse motif_primitive motif_arrow_button motif_label motif_cascade_button motif_drawn_button motif_push_button motif_toggle_button motif_list motif_scrolled_list motif_scroll_bar motif_separator motif_text motif_scrolled_text


Please send comments and suggestions to
consult@rpi.edu