Webhosting and cheap domain registration service
  

 Home

Prev GtkMenu::popup Next

GtkMenu::popup

void popup([ GtkWidget parent_menu_shell , [ GtkWidget parent_menu_item , [ GtkMenuPositionFunc pos_function , int button, int activate_time]]]);

The popup() method looks fairly intimidating at the outset, but is actually quite straightforward to use.

The first thing to be aware of is that the parent_menu_shell and parent_menu_item parameters would generally only be used internally, to associate the popped-up menu with a given GtkMenuShell descendant, or GtkMenuItem, or both. In a freestanding popup menu, both parameters should be passed as null.

The third parameter concerns the positioning of the popup menu, and has as its default the position of the mouse pointer. In order to set a different position, you will need to set up a function that will return an array of the co-ordinates, and call it from the pos_function parameter.

The fourth parameter refers to the mouse button emitting the "button-release-event" that will be compared with the button emitting the "button-press-event" in order to set the timer in the final parameter. This only works if you happen to be triggering the popup function with a button press, and the button pressed and button released are the same - in all other situations, the time element is ignored. However, setting the button parameter to 1 or 3 will speed up the deactivation when the left or right mouse button is released respectively, regardless of the callback event.

The final parameter, activate_time, sets the time conditions for the menu's deactivation. If you have used a button press event and ensured that the initial press and later release have the same valid integer value, then setting the timer to 0 will make the menu disappear as soon as the user releases the mouse-button that triggered it. The safest setting for this parameter is $event->time - this being a setting that all GdkEvent structures share; it causes the popup menu to react as you'd expect it to, and won't spring any surprises if you duplicate or otherwise adapt the original callback event.


Prev Home Next
GtkMenu Constructor Up GtkMenu::reposition

 

  

Network sites:

Cheap domain registrar's cheap domain registration service

$8.95 domain registration : Buy domain name or register domain name 

 
 
Quotes:
No man ever steps in the same river twice, for it's not the same river and he's not the same man.What experience and history teach is this - that nations and governments have never learned anything from history, or acted upon any lessons they might have drawn from it.The first glance at History convinces us that the actions of men proceed from their needs, their passions, their characters and talents; and impresses us with the belief that such needs, passions and interests are the sole spring of actions.Reason is the substance of the universe. The design of the world is absolutely rational.  
 
 

Disclaimer: This documentation is provided only for the benefits of our webhosting customers.
For authoritative source of the documentation, please refer to http://gtk.php.net/docs.php