. Updated Daily. Editions SDA India   SDA Indonesia
BUSINESS ENTERPRISE SOLUTIONS ARCHITECTURE INFORMATION SECURITY WIRELESS & MOBILITY DATA & STORAGE DEVELOPMENT HARDWARE













News

Monday, 26 March 2007

Popup Menu Dialog with GtkMenu Class

 

 

Marc Quinton over a post in PHPGTK shows a way to build a popup menu supporting event registration from a GtkWidget. He informs you that menu items are passed to the class constructor as a list of labels. This class emits activate signals with full context.

He gives the details in the following points:

  • Create Gtk standard stuff,
  • Create a Popup menu in a single a simple line with three items (Edit, Cut, Paste),
  • Connect an ‘activate’ callback
  • Some items can be insensitive depending on application context,
  • Set parent widget; this widget must contain a Window to register some buttons events. No warning about that in this current code, but could be done,
  • Look at activate callback; complete event context is available, containing (x,y) coordinates ; may be useful in some usages.

He concludes by giving an example code to carry out the procedure. He also updates that Popup::set_parent() method should be added to avoid simplify event and signal registration.

 

Read the Post

 
 
print save email comment

print

save

email

comment

 
 

Search SDA Asia

Free eNewsletter

SDA Asia Magazine Free Download
 
 
 
Copyright @ 2009 SDA Asia Magazine - All Right Reserved Privacy Policy | Terms of Use