Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » GTK+
  • » Problems - GTK no receiving signals - no running callbacks [RSS Feed]

#1 Nov. 8, 2005 17:29:34

Flavio A.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Problems - GTK no receiving signals - no running callbacks


Hello all, I'm creating an application using GTK+ 2.6.4-3, your
interface was made using glade-2 and I connected some functions on some
signals of main window (the single window at now), these signals are
"activate_default", "activate_focus", "show", "destroy", but when I ran
the program the callbacks from these signals was not called, what I did
wrong ? Why the callbacks aren't called ?

I using libglade in this program and the "pressed-button" signal are
working OK, but the signal "show" not, I create a simple test program
using glade-2 not using libglade and the behaviour are the same - no
callbacks called for "show" signal.

My application will run "stand-alone" (out of GNOME/KDE etc) in PC and
the window hasn't decorations.

My development system is Debian Sarge with kernel 2.6.8-2-k7.

Bellow are my .glade file (start) with the signal definitions and the
piece of the callbacks.c of these callback.

Thanks for any help.

<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd";>

<glade-interface>

<widget class="GtkWindow" id="window_main">
<property name="width_request">1024</property>
<property name="height_request">768</property>
<property name="visible">True</property>
<property name="events">GDK_EXPOSURE_MASK</property>
<property name="title" translatable="yes">MAQFACE</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property>
<property name="modal">True</property>
<property name="default_width">1024</property>
<property name="default_height">768</property>
<property name="resizable">False</property>
<property name="destroy_with_parent">False</property>
<property name="icon">logo_small.png</property>
<property name="decorated">False</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="activate_default"
handler="on_window_main_activate_default" last_modification_time="Tue,
08 Nov 2005 12:19:09 GMT"/>
<signal name="activate_focus" handler="on_window_main_activate_focus"
last_modification_time="Tue, 08 Nov 2005 12:19:54 GMT"/>
<signal name="show" handler="on_window_main_show"
last_modification_time="Tue, 08 Nov 2005 12:21:11 GMT"/>
<signal name="destroy" handler="on_window_main_destroy"
last_modification_time="Tue, 08 Nov 2005 12:21:36 GMT"/>

<child>
<widget class="GtkEventBox" id="eventbox_main">
<property name="visible">True</property>
<property name="visible_window">True</property>
<property name="above_child">False</property>
.
.
.


callbacks.c :

void
on_window_main_activate_default (GtkWindow *window,
gpointer user_data)
{
printf("ACTIVATE DEFAULT\n");
}


void
on_window_main_activate_focus (GtkWindow *window,
gpointer user_data)
{
printf("ACTIVATE FOCUS\n");
}


void
on_window_main_show (GtkWidget *widget,
gpointer user_data)
{
printf("MAIN SHOW\n");
}


void
on_window_main_destroy (GtkObject *object,
gpointer user_data)
{
printf("MAIN DESTROY\n");
}




--
Flavio Alberto Lopes Soares <>

_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

#2 Nov. 8, 2005 18:13:10

Tristan V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

Problems - GTK no receiving signals - no running callbacks


Flavio Alberto Lopes Soares wrote:Hello all, I'm creating an application using GTK+ 2.6.4-3, your
interface was made using glade-2 and I connected some functions on some
signals of main window (the single window at now), these signals are
"activate_default", "activate_focus", "show", "destroy", but when I ran
the program the callbacks from these signals was not called, what I did
wrong ? Why the callbacks aren't called ?Quote from libglade home page :"Libglade can also automatically connect signal handlers in the userinterface. It does this by matching handler names specified in the gladefile with symbols in the executable looked up with the gmodule library(this requires that applications be linked with the --export-dynamic flag)."The classic reason for this to not work is that people forget
to put --rdynamic or --export-dynamic on the command line when
compiling thier application.

Cheers,
-Tristan

http://www.jamesh.id.au/software/libglade/_______________________________________________
gtk-list mailing list
gtk-list@gnome.orghttp://mail.gnome.org/mailman/listinfo/gtk-list

Offline

  • Root
  • » GTK+
  • » Problems - GTK no receiving signals - no running callbacks [RSS Feed]

Board footer

Moderator control

Enjoy the 18th of November
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support