Hexmap Gtk+ Bindings Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
struct HexDisplayGtk; struct HexDisplayGtkClass; GtkWidget* hex_display_gtk_new (HexGrid *grid); void hex_display_gtk_set_grid (HexDisplayGtk *disp, HexGrid *grid); HexGrid* hex_display_gtk_get_grid (HexDisplayGtk *disp); void hex_display_gtk_center_hex (HexDisplayGtk *disp, guint x, guint y); GdkEventMask hex_display_gtk_get_hex_events (HexDisplayGtk *disp); void hex_display_gtk_set_hex_events (HexDisplayGtk *disp, GdkEventMask events); #define HEX_DISPLAY_GTK_HEX_EVENT_MASK |
"hex-event" gboolean user_function (HexDisplayGtk *hexdisplaygtk, GdkEvent *event, gint arg1, gint arg2, gpointer user_data); |
A HexDisplayGtk is a GtkWidget which displays a HexGrid. Since most of what it does is react to changes in HexGrid, once you've set the grid there's not much hexmap-specific functionallity.
GtkWidget* hex_display_gtk_new (HexGrid *grid); |
create a HexDisplayGtk
the HexGrid to display. Can be NULL
the newly created HexDisplayGtk
void hex_display_gtk_set_grid (HexDisplayGtk *disp, HexGrid *grid); |
set which HexGrid to display
the HexGrid to display. Can be NULL
HexGrid* hex_display_gtk_get_grid (HexDisplayGtk *disp); |
get the currently displayed HexGrid
the currently displayed HexGrid. Returns NULL if there is no grid
void hex_display_gtk_center_hex (HexDisplayGtk *disp, guint x, guint y); |
center the display on the hex (x, y)
the x coordinate of a hex
the y coordinate of a hex
GdkEventMask hex_display_gtk_get_hex_events (HexDisplayGtk *disp); |
Returns the events sent by HexObject::event and HexDisplayGtk::hex-event.
The event mask
void hex_display_gtk_set_hex_events (HexDisplayGtk *disp, GdkEventMask events); |
Sets the events sent by HexObject::event and HexDisplayGtk::hex-event to (events | HEX_DISPLAY_GTK_HEX_EVENT_MASK).
a mask which determines which events are sent
#define HEX_DISPLAY_GTK_HEX_EVENT_MASK |
A mask indicating which events a HexDisplayGtk is capable of transmitting to HexObject instances
gboolean user_function (HexDisplayGtk *hexdisplaygtk, GdkEvent *event, gint arg1, gint arg2, gpointer user_data); |
An event has occured in the hex at (x, y). This function is called after HexObject::event is called for any HexObject in the hex. The events sent are set by hex_display_set_hex_events(). The default is no events, and is in any case restricted to those in HEX_DISPLAY_GTK_HEX_EVENT_MASK. Known bugs: Since the hexes don't have their own windows, the GDK_ENTER_NOTIFY and GDK_LEAVE_NOTIFY events are synthetic. Therefore, GdkEventCrossing::subwindow is not what would be expected (and often NULL), and (FIXME) GdkEventCrossing::focus is probably incorrect in most cases.
the object which received the signal.
a GdkEvent
the x coordinate of the hex
the y coordinate of the hex
user data set when the signal handler was connected.
TRUE to stop propagation of the event