Re: [gedit-list] Custom toolbar icons

Thanks for the help.

Good to hear that you are providing official support for macros in
gedit. I already developed a small plugin for macro and hosted it on Now I am working on few
enhancements like adding toolbar icons for easier access, saving of
macros, etc.

I am new to Linux application development and Its my pleasure to work
with you people.

On Mon, Mar 15, 2010 at 2:56 PM, Jesse van den Kieboom
<jessevdk gnome org> wrote:
> Sam K. Raju wrote:
>> Hi All,
>> How can I add custom toolbar icons to the gEdit window in my gedit plugin?
>> I defined the following string array for menu items and toolbar
>> buttons in my plugin.
>> const gchar submenu_macro[] =
>> "<ui>"
>> "  <menubar name='MenuBar'>"
>> "    <menu name='ToolsMenu' action='Tools'>"
>> "      <placeholder name='ToolsOps_3'>"
>> "        <menu action='Macro'>"
>> "          <menuitem action='StartRecordMacro'/>"
>> "          <menuitem action='StopRecordMacro'/>"
>> "          <menuitem action='PlaybackMacro'/>"
>> "        </menu>"
>> "      </placeholder>"
>> "    </menu>"
>> "  </menubar>"
>> "  <toolbar name='ToolBar'>"
>> "    <separator/>"
>> "    <toolitem action='StartRecordMacro' icon='record-macro.png'/>"
>> "    <toolitem action='StopRecordMacro' icon='stop-macro.png'/>"
>> "    <toolitem action='PlaybackMacro' icon='play-macro.png'/>"
>> "    <separator/>"
>> "  </toolbar>"
>> "</ui>";
>> After compilation, the toolbar buttons are added but there is no icon
>> on the buttons. How should I specify the icons for the toolbar buttons
>> and where the icons files should be placed during the installation?
> You specify the icons when you define the actions (see the stock-id
> property of the GtkAction). This way you can specify stock icons or
> named theme icons. In addition, you can set the 'gicon' property of the
> GtkAction after it's constructed.
> What might be worth mentioning (looking at the names of the actions), is
> that we're planning official support for macro's as a plugin in the
> gedit core or gedit-plugins package. It would be cool to avoid double
> work, maybe you're interested in some collaboration?
> Jesse

Sam K. Raju

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