GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Aug 26, 2016 11:57 am

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Popup menu from glade file troubles.
PostPosted: Thu Jan 02, 2014 2:20 am 

Joined: Thu Mar 14, 2013 12:19 am
Posts: 1
I am having issues getting a popup created in Glade to work. I click the popup menu widget in Glade 3, and proceed to add items/widgets to the GTKMenu and save the file. In my source, I get the popup object during initialization with gtk_builder_get_object as I do for the other objects:

    mov     rsi, szSFS_SearchMenu
    mov     rdi, r15
    call    gtk_builder_get_object
    mov     [oSFSMenu], rax

Which returns a valid object. I can then call gtk_widget_get_name with this returned object and it returns GtkMenu.

To test and show this popup menu, I use this signal handler:
    call    gtk_get_current_event_time
    push    rax   
    mov     r9, 0
    mov     r8, 0
    mov     rcx, 0
    mov     rdx, 0
    mov     rsi, 0
    mov     rdi,[oSFSMenu]
    call    gtk_menu_popup
    pop     rax

Which when I click the a button to show this menu, I get:
(sfslc:2668): Gtk-CRITICAL **: gtk_menu_popup: assertion `GTK_IS_MENU (menu)' failed

Now, if I create a test menu by hand:
    call    gtk_menu_new
    mov     [oSFSMenu], rax
    mov     rdi, szBtn_Clear
    call    gtk_menu_item_new_with_label
    mov     rsi, rax
    mov     rdi, [oSFSMenu]
    call    gtk_menu_shell_append
    mov     rdi, [oSFSMenu]
    call    gtk_widget_show_all

And use the same signal handler above, the popup menu is shown. What do I need to do to get the popup menu from the glade file to work?

 Post subject: Re: Popup menu from glade file troubles.
PostPosted: Sun Jan 05, 2014 6:55 am 
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 1048
Location: UK

Without knowing what the Glade file or even what versions of Glade and GTK+ you are using it is hard to say what is wrong.

I am not sure why you are using assembly as this is a very difficult way of programming which can introduce errors without any easy method of checking. You will also lose portability between processor types, going between 32/64 bit versions of a processor of even between the same processor with a different OS.


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: pepsidrinker and 5 guests

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