GTKWidget *toolbar in PidginConversation
Marco Monteiro
nok.marco at gmail.com
Sun May 24 18:28:46 EDT 2009
2009/5/24 Diego Acuña <diego.desu at googlemail.com>
> oh thank you for your help, now it works for me. I saw your plugin and i
> learned a lot from it.
>
> one more question, where you got that information? in the api documentation
> there's nothing of it.
>
> Thanks for your time.
>
> 2009/5/24 Marco Monteiro <nok.marco at gmail.com>
>
> Hi,
>>
>> 2009/5/23 Diego Acuña <diego.desu at googlemail.com>
>>
>>> well, i'm trying to make a plugin for pidgin, in this plugin i've to put
>>> a button in the toolbar of the conversation (in pidgin), all this runs okey
>>> but the button appears in the right side of the toolbar (far from the
>>> smilies button), somebody knows how to put the button right after the
>>> smilies button??.
>>>
>>> Here's my code to put the button:
>>>
>>> static void
>>>> create_button (PidginConversation *conv)
>>>> {
>>>> GtkWidget *button, *image, *vs;
>>>>
>>>> button = gtk_button_new();
>>>> gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
>>>> g_signal_connect(G_OBJECT(button), "clicked",
>>>> G_CALLBACK(send_button_cb), conv);
>>>>
>>>> image = gtk_image_new_from_file(".purple/button.png");
>>>>
>>>> gtk_container_add((GtkContainer *)button, image);
>>>>
>>>> vs = gtk_vseparator_new();
>>>>
>>>> gtk_widget_show(vs);
>>>> gtk_widget_show_all(button);
>>>>
>>>> gtk_box_pack_start(GTK_BOX(conv->toolbar), vs, FALSE, FALSE, 0);
>>>> gtk_box_pack_start(GTK_BOX(conv->toolbar), button, FALSE, FALSE, 0);
>>>>
>>>> g_object_set_data(G_OBJECT(conv->toolbar), "plugin_separator", vs);
>>>> g_object_set_data(G_OBJECT(conv->toolbar), "plugin_button", button);
>>>> }
>>>
>>>
>>> any idea?
>>>
>>> thanks for your time! bye.
>>>
>>> _______________________________________________
>>> Devel mailing list
>>> Devel at pidgin.im
>>> http://pidgin.im/cgi-bin/mailman/listinfo/devel
>>>
>>>
>>
>> The toolbar have inside of it an horizontal bar and you've to put the
>> button inside of this horizontal bar. Otherwise it will appears after the
>> horizontal bar, on the right side of the toolbar
>> In fact, the toolbar have two horizontal bar. One is visible when items
>> are grouped and other when aren't.
>>
>> This code will do what you want:
>>
>> static void
>> create_button (PidginConversation *conv)
>> {
>> GtkWidget *toolbar;
>>
>> /* Put here the code to create the button */
>>
>> /* One horizontal bar */
>> toolbar = g_object_get_data(G_OBJECT(conv->toolbar), "lean-view");
>>
>> gtk_box_pack_start(GTK_BOX(toolbar), vs, FALSE, FALSE, 0);
>> gtk_box_pack_start(GTK_BOX(toolbar), button, FALSE, FALSE, 0);
>> }
>>
>> I'm not sure how to add the button in the other horizontal bar, but I
>> think that you have to use "wide-view" instead of "lean-view"
>>
>> You can take a look on this plugin made by me:
>> http://code.google.com/p/pidgin-attentionbutton/source/browse/trunk/attentionbutton.c
>>
>> --
>> Marco Monteiro
>>
>> Linux User #443808
>> Ubuntu User #22730
>>
>
>
I had to look into Pidgin's source code. It was the only way I had to get
the information.
--
Marco Monteiro
Linux User #443808
Ubuntu User #22730
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20090524/6b5ba2e7/attachment.html>
More information about the Devel
mailing list