[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pidgin-devel
Subject:    Re: GTKWidget *toolbar in PidginConversation
From:       Marco Monteiro <nok.marco () gmail ! com>
Date:       2009-05-24 22:28:46
Message-ID: 298e60970905241528g99fbc92j1a1e9406725fa4c8 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


2009/5/24 Diego Acuņa <diego.desu@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@gmail.com>
>
> Hi,
>>
>> 2009/5/23 Diego Acuņa <diego.desu@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@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

[Attachment #5 (text/html)]

<br><br><div class="gmail_quote">2009/5/24 Diego Acuņa <span dir="ltr">&lt;<a \
href="mailto:diego.desu@googlemail.com">diego.desu@googlemail.com</a>&gt;</span><br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;">

oh thank you for your help, now it works for me. I saw your plugin and i learned a \
lot from it.<br><br>one more question, where you got that information? in the api \
documentation there&#39;s nothing of it.<br><br>Thanks for your time.<br>



<br><div class="gmail_quote">2009/5/24 Marco Monteiro <span dir="ltr">&lt;<a \
href="mailto:nok.marco@gmail.com" \
target="_blank">nok.marco@gmail.com</a>&gt;</span><div><div></div><div \
class="h5"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



Hi,<br><br><div class="gmail_quote">2009/5/23 Diego Acuņa <span dir="ltr">&lt;<a \
href="mailto:diego.desu@googlemail.com" \
target="_blank">diego.desu@googlemail.com</a>&gt;</span><br><blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;">



<div><div></div><div>

well, i&#39;m trying to make a plugin for pidgin, in this plugin i&#39;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??.<br>







<br>Here&#39;s my code to put the button:<br><br><blockquote style="border-left: 1px \
solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" \
class="gmail_quote">static void<br>create_button (PidginConversation *conv)<br>







{<br>    GtkWidget *button, *image, *vs;<br>    <br>    button = \
gtk_button_new();<br>    gtk_button_set_relief(GTK_BUTTON(button), \
GTK_RELIEF_NONE);<br>    g_signal_connect(G_OBJECT(button), &quot;clicked&quot;, \
G_CALLBACK(send_button_cb), conv);<br>







<br>    image = gtk_image_new_from_file(&quot;.purple/button.png&quot;);<br><br>    \
gtk_container_add((GtkContainer *)button, image);<br><br>    vs = \
gtk_vseparator_new();<br><br>    gtk_widget_show(vs);<br>    \
gtk_widget_show_all(button);<br>







<br>    gtk_box_pack_start(GTK_BOX(conv-&gt;toolbar), vs, FALSE, FALSE, 0);<br>    \
gtk_box_pack_start(GTK_BOX(conv-&gt;toolbar), button, FALSE, FALSE, 0);<br><br>    \
g_object_set_data(G_OBJECT(conv-&gt;toolbar), &quot;plugin_separator&quot;, vs);<br>







    g_object_set_data(G_OBJECT(conv-&gt;toolbar), &quot;plugin_button&quot;, \
button);<br>}</blockquote><div><br>any idea?<br><br>thanks for your time! \
bye.<br></div> <br></div></div>_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@pidgin.im" target="_blank">Devel@pidgin.im</a><br>
<a href="http://pidgin.im/cgi-bin/mailman/listinfo/devel" \
target="_blank">http://pidgin.im/cgi-bin/mailman/listinfo/devel</a><br> \
<br></blockquote></div><br><br>The toolbar have inside of it an horizontal bar and \
you&#39;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<br>





In fact, the toolbar have two horizontal bar. One is visible when items are grouped \
and other when aren&#39;t.<br><br>This code will do what you want:<div><br><br>static \
void<br>create_button (PidginConversation *conv)<br>





{<br></div>    GtkWidget *toolbar;<br>    <br>    /* Put here the code to create the \
button */<br><br>    /* One horizontal bar */<br>  toolbar = \
g_object_get_data(G_OBJECT(conv-&gt;toolbar), &quot;lean-view&quot;);<br><br>    \
gtk_box_pack_start(GTK_BOX(toolbar), vs, FALSE, FALSE, 0);<br>    \
gtk_box_pack_start(GTK_BOX(toolbar), button, FALSE, FALSE, 0);<br>





}<br><br>I&#39;m not sure how to add the button in the other horizontal bar, but I \
think that you have to use &quot;wide-view&quot; instead of \
&quot;lean-view&quot;<br><br>You can take a look on this plugin made by me: <a \
href="http://code.google.com/p/pidgin-attentionbutton/source/browse/trunk/attentionbutton.c" \
target="_blank">http://code.google.com/p/pidgin-attentionbutton/source/browse/trunk/attentionbutton.c</a><br \
clear="all">



<font color="#888888">

<br>-- <br>Marco Monteiro<br><br>Linux User #443808<br>Ubuntu User #22730<br>
</font></blockquote></div></div></div><br>
</blockquote></div><br>I had to look into Pidgin&#39;s source code. It was the only \
way I had to get the information.<br clear="all"><br>-- <br>Marco \
Monteiro<br><br>Linux User #443808<br>Ubuntu User #22730<br>



_______________________________________________
Devel mailing list
Devel@pidgin.im
http://pidgin.im/cgi-bin/mailman/listinfo/devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic