Re: [anjuta-devel] Error while compiling Anjuta source



Hi,

I have written a G_CALLBACK function using the approach given by you.
But the problem is that the Terminal does not even detect the signal
"Alt+E". While Debugging I found out that on pressing the keys "Alt+E"
the program does not execute the G_CALLBACK function. Currently this
is what I have added inside the GtkActionsEntry actions_terminal:

{
        "ActionCommandToTerminal-ALTE"
,
        NULL,
        N_("Alt-E"),
        "<Alt>E",
        NULL,
        G_CALLBACK (on_terminal_shift)
   },

and I have simply written a print statement inside the
on_terminal_shift function for debugging purpose. But when I press the
key, it does not execute the print statement.

Is something else also required to be written for keypress event
detection apart from adding an entry inside the GtkActionsEntry
actions_terminal?

Thanks and Regards,
Kriti
IRC nick- kan4

On Mon, Nov 4, 2013 at 12:33 AM, Johannes Schmid <jhs jsschmid de> wrote:
Hi!

Am Sonntag, den 03.11.2013, 21:24 +0530 schrieb Kriti Kansal:
Thanks a lot! I was already trying to fix this bug[1] :

[1] https://bugzilla.gnome.org/show_bug.cgi?id=708792

which Sebastien has suggested to me. I have already started working on
it. I will try to work on the given bug as soon as this one is done.

OK, sorry, didn't notice that Sébastian already gave you that bug.

But I am facing problems in writing the G_CALLBACK
function(on_terminal_shift). I have thought of using the
gtk_window_get_focus and gtk_window_set_focus functions in order to
shift the cursor focus from Terminal to Editor. But
gtk_window_get_focus requires the GTK window of the current
terminal(in which the cursor is). I am not able to find the instance
of terminal window which I can pass to this function as well as the
instance of the editor window which I can pass in the
gtk_window_set_focus function.

Can you please provide me some help in writing the G_CALLBACK
function. Or if there is any other way of writing this function please
suggest me.

You should look into anjuta_shell_present_widget() methods which
activates the given widget (e.g. gives focus). The challenge is to get
the widget of the terminal. That is possible to by by receiving the
plugin object of the terminal with anjuta_shell_get_interface/object()
and then look for the widget inside the terminal plugin (maybe a new
access method is needed).

Ah, and if you are wondering how to get the shell object -
anjuta_plugin_get_shell() is your friend.

There are various docs on these methods available.

Regards,
Johannes


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