GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Jul 23, 2014 3:43 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Menu to toolbar
PostPosted: Thu Dec 29, 2011 2:48 pm 
Offline
GTK+ Geek

Joined: Sat Sep 03, 2011 6:36 pm
Posts: 94
I remember that zerohour said that he came up with a method with which he can place a gtk_menu to a gtk_tool_item.I would like to see how that is done.(i dont want a gtk_combo tool button which is not what i want to ..i want to click to a toolbar item and then a gtk_menu to appear under that toolbar item.


Top
 Profile  
 
 Post subject: Re: Menu to toolbar
PostPosted: Sun Jan 08, 2012 10:55 pm 
Offline
GTK+ Guru

Joined: Fri Mar 25, 2011 5:16 pm
Posts: 177
Location: USA
Sorry I don't remember saying that. Which post?


Top
 Profile  
 
 Post subject: Re: Menu to toolbar
PostPosted: Tue Jan 10, 2012 12:29 pm 
Offline
GTK+ Geek

Joined: Sat Sep 03, 2011 6:36 pm
Posts: 94
woops sorry man it wasnt you who posted...heres the link viewtopic.php?f=3&t=55270&p=71466#p71466 i would really like to know how it can be done


Top
 Profile  
 
 Post subject: Re: Menu to toolbar
PostPosted: Fri Jan 13, 2012 10:35 am 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Well, I guess I was the one that provided that "good-for-nothing" response;) Maybe it's time to fix this.

The idea behind that is really simple. Detect button click by connecting signal handler to one of the button's signals and pop-up the menu from there. The function you'll need is gtk_menu_popup() and here is that tricky part: the GtkMenuPositionFunc parameter. If you want to position your menu just below the button, you'll need to calculate the proper position for menu.

Currently I lack access to machine with GTK+ dev. environment, so I cannot offer any more specific help. Try playing with thi stuff a bit and see what you can come up with.

Cheers,
Tadej


Top
 Profile  
 
 Post subject: Re: Menu to toolbar
PostPosted: Thu Mar 08, 2012 9:00 am 
Offline
GTK+ Geek

Joined: Sat Sep 03, 2011 6:36 pm
Posts: 94
God bless you....i finally managed to achieve that as you said so :) now i only need to make the correct positioning...darn.. :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group