Re: problem on gsinal

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Zhenghe Zhang wrote:
> I am sorry to obtrude you, but i have been graveled for long time, can
> you give me some advises.
> 
> Text Box: button = gtk_dialog_add_button(GTK_DIALOG(dialog), "More",
> GTK_RESPONSE_ACCEPT); g_signal_connect(G_OBJECT(button),
> "clicked",G_CALLBACK(callback_file_more_button),button);

I thought a little more, here's my suggestion.

const gint RESPONSE_MORE = 1;

button = gtk_dialog_add_button(GTK_DIALOG(dialog), "More", RESPONSE_MORE);

g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(callback_file_more_button), button);

Or...

g_signal_connect(G_OBJECT(button), "response",
G_CALLBACK(callback_file_more_button), button);

and in callback_file_more_button, check that response_id is 1.

That way, your callback *is* the default handler.

Cheers,
Dave.
-- 
maemo.org docsmaster
Email: dneary@xxxxxxxxx
Jabber: bolsh@xxxxxxxxxx

_______________________________________________
maemo-users mailing list
maemo-users@xxxxxxxxx
https://lists.maemo.org/mailman/listinfo/maemo-users

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Big List of Linux Books]    

  Powered by Linux