In the ipdf app. the events in the toolbar buttons are send to the ipcCbk function. You set the call back function with:
Code:
erIpcChannel = channel;
int fd = erIpcGetServerFd(channel);
gdk_input_add (fd,
GDK_INPUT_READ,
(GdkInputFunction) ipcCbk,
(gpointer) this);
when you set a icon the last parameter is a code send to de ipcCbk when you click on the icon. then you can set a icon like:
Code:
tbAppendPlatformIcon( ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pan, ccVwrToolbar);
and in the ipcCbk do:
Code:
void IliadToolbar::ipcCbk(gpointer client_data, gint *fd, GdkInputCondition id)
{
IliadToolbar *toolBar = (IliadToolbar *) client_data;
char szBuffer[IPC_BUF_MAX];
int nBuf = IPC_BUF_MAX;
erIpcCmd_t command;
erServerChannel_t channel = toolBar->erIpcChannel;
erIpcGetMessage(channel, szBuffer, &nBuf);
if (vwrParseCommand(szBuffer, &command) >= 0)
{
switch (command.cc)
{
case ccVwrToolbar:
In when ccVwrToolbar is recibed ipdf check the icon name to decide the action to take.
As how you show/hide the keyboar you can see the settings app code in:
http://iliad.hpelbers.org/irexdox/se...735f93a6ced14a
the method show_keyboard.