Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

Etk_Popup_Window


Detailed Description

The Etk_Popup_Window widget is a borderless window that can pops up/down. It is used by menus and comboboxes.

When a popup window is popped up, it grabs the keyboard and the mouse input so the user won't be able to manipulate the other windows. To pop down the window, the user has to click outside of it.
If the popup window intersects one of the edges of the screen, the popup window will slide smoothly when the mouse pointer reaches this edge.
You usually do not need to directly create a popup window in your programs, use Etk_Menu or Etk_Combobox instead. However, Etk_Popup_Window can be useful if you are creating a new widget.

Object Hierarchy:
  • Etk_Object
    • Etk_Widget
      • Etk_Container
        • Etk_Bin
          • Etk_Toplevel
            • Etk_Window
              • Etk_Popup_Window
Signals:
  • "popped-up": Emitted when the popup window is popped up
    • Callback: void callback(Etk_Popup_Window *popup_window, void *data)
      • popup_window: the popup window which has been popped up
      • data: the user data set when the callback has been connected to the signal
  • "popped-down": Emitted when the popup window is popped down
    • Callback: void callback(Etk_Popup_Window *popup_window, void *data)
      • popup_window: the popup window which has been popped down
      • data: the user data set when the callback has been connected to the signal


Data Structures

struct  Etk_Popup_Window
 [Widget] A borderless window that can be popped up/down More...

Defines

#define ETK_POPUP_WINDOW_TYPE   (etk_popup_window_type_get())
#define ETK_POPUP_WINDOW(obj)   (ETK_OBJECT_CAST((obj), ETK_POPUP_WINDOW_TYPE, Etk_Popup_Window))
#define ETK_IS_POPUP_WINDOW(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_POPUP_WINDOW_TYPE))

Enumerations

enum  Etk_Popup_Direction {
  ETK_POPUP_BELOW_RIGHT,
  ETK_POPUP_BELOW_LEFT,
  ETK_POPUP_ABOVE_RIGHT,
  ETK_POPUP_ABOVE_LEFT
}
 The directions to which the popup window is popped up. More...

Functions

void etk_popup_window_parent_set (Etk_Popup_Window *popup_window, Etk_Popup_Window *parent)
 Sets the parent of the popup window. It is used by popup windows that can make other windows pop up, such as the menus.
Etk_Popup_Window * etk_popup_window_parent_get (Etk_Popup_Window *popup_window)
 Gets the parent of the popup window.
void etk_popup_window_focused_window_set (Etk_Popup_Window *popup_window)
 Sets the focused popup window. The focused window is the one which will receive the keyboard events. When a popup window is popped up, it is automatically focused.
Etk_Popup_Window * etk_popup_window_focused_window_get (void)
 Gets the focused popup window.
void etk_popup_window_popup (Etk_Popup_Window *popup_window)
 Pops up the popup window at the mouse pointer position.
void etk_popup_window_popup_in_direction (Etk_Popup_Window *popup_window, Etk_Popup_Direction direction)
 Pops up the popup window at the mouse pointer position, in the given direction.
void etk_popup_window_popup_at_xy (Etk_Popup_Window *popup_window, int x, int y)
 Pops up the popup window at the position (x, y). If the parent of the popup window has already a child which is popped up, the child will be automatically popped down.
void etk_popup_window_popup_at_xy_in_direction (Etk_Popup_Window *popup_window, int x, int y, Etk_Popup_Direction direction)
 Pops up the popup window at the position (x, y). If the parent of the popup window has already a child which is popped up, the child will be automatically popped down.
void etk_popup_window_popdown (Etk_Popup_Window *popup_window)
 Pops down the popup window and its children.
void etk_popup_window_popdown_all (void)
 Pops down all the popped windows.
Etk_Bool etk_popup_window_is_popped_up (Etk_Popup_Window *popup_window)
 Gets whether the popup window is popped up.


Define Documentation

#define ETK_POPUP_WINDOW_TYPE   (etk_popup_window_type_get())

Gets the type of a popup window

#define ETK_POPUP_WINDOW ( obj   )     (ETK_OBJECT_CAST((obj), ETK_POPUP_WINDOW_TYPE, Etk_Popup_Window))

Casts the object to an Etk_Popup_Window

#define ETK_IS_POPUP_WINDOW ( obj   )     (ETK_OBJECT_CHECK_TYPE((obj), ETK_POPUP_WINDOW_TYPE))

Check if the object is an Etk_Popup_Window


Enumeration Type Documentation

enum Etk_Popup_Direction

The directions to which the popup window is popped up.

Enumerator:
ETK_POPUP_BELOW_RIGHT  The window is popped up on the right, below the given position (default)
ETK_POPUP_BELOW_LEFT  The window is popped up on the left, below the given position
ETK_POPUP_ABOVE_RIGHT  The window is popped up on the right, above the given position
ETK_POPUP_ABOVE_LEFT  The window is popped up on the left, above the given position


Function Documentation

void etk_popup_window_parent_set ( Etk_Popup_Window *  popup_window,
Etk_Popup_Window *  parent 
)

Sets the parent of the popup window. It is used by popup windows that can make other windows pop up, such as the menus.

Parameters:
popup_window a popup_window
parent the parent of the popup_window

Etk_Popup_Window * etk_popup_window_parent_get ( Etk_Popup_Window *  popup_window  ) 

Gets the parent of the popup window.

Parameters:
popup_window a popup_window
Returns:
Returns the parent of the popup window

void etk_popup_window_focused_window_set ( Etk_Popup_Window *  popup_window  ) 

Sets the focused popup window. The focused window is the one which will receive the keyboard events. When a popup window is popped up, it is automatically focused.

Parameters:
popup_window the popup window to focus. If NULL, the last popped window will be automatically focused
Note:
The popup window should be popped up to be focused

Etk_Popup_Window * etk_popup_window_focused_window_get ( void   ) 

Gets the focused popup window.

Returns:
Returns the focused popup window

void etk_popup_window_popup ( Etk_Popup_Window *  popup_window  ) 

Pops up the popup window at the mouse pointer position.

Parameters:
popup_window a popup window
Note:
This is equivalent to etk_popup_window_popup_in_direction(popup_window, ETK_POPUP_BELOW_RIGHT)

void etk_popup_window_popup_in_direction ( Etk_Popup_Window *  popup_window,
Etk_Popup_Direction  direction 
)

Pops up the popup window at the mouse pointer position, in the given direction.

Parameters:
popup_window a popup window
direction the direction to which the window should be popped up

void etk_popup_window_popup_at_xy ( Etk_Popup_Window *  popup_window,
int  x,
int  y 
)

Pops up the popup window at the position (x, y). If the parent of the popup window has already a child which is popped up, the child will be automatically popped down.

Parameters:
popup_window a popup window
x the x position where to pop up the popup window
y the y position where to pop up the popup window
Note:
This is equivalent to etk_popup_window_popup_at_xy_in_direction(popup_window, x, y, ETK_POPUP_BELOW_RIGHT)

void etk_popup_window_popup_at_xy_in_direction ( Etk_Popup_Window *  popup_window,
int  x,
int  y,
Etk_Popup_Direction  direction 
)

Pops up the popup window at the position (x, y). If the parent of the popup window has already a child which is popped up, the child will be automatically popped down.

Parameters:
popup_window a popup window
x the x position where to pop up the popup window
y the y position where to pop up the popup window
direction the direction to which the window should be popped up
Note:
This is equivalent to etk_popup_window_popup_at_xy_in_direction(popup_window, x, y, ETK_POPUP_BELOW_RIGHT)

void etk_popup_window_popdown ( Etk_Popup_Window *  popup_window  ) 

Pops down the popup window and its children.

Parameters:
popup_window a popup window

void etk_popup_window_popdown_all ( void   ) 

Pops down all the popped windows.

Etk_Bool etk_popup_window_is_popped_up ( Etk_Popup_Window *  popup_window  ) 

Gets whether the popup window is popped up.

Parameters:
popup_window a popup window
Returns:
Returns ETK_TRUE if the popup window is popped up, ETK_FALSE otherwise