Re: gtk question.



Thanks for your reply. I would like to emitt an event after have used the gtk method to create a window (the word I used before was FORM)
the method I use for is gtk_window_new() call from a wrapper.

/* Create new window */
C_EXTERN GtkWidget *CBL_OC_GTK_WINDOW_NEW()
{
   return gtk_window_new(GTK_WINDOW_TOPLEVEL);
}

Federico

----- Original Message ----- From: "David Nečas" <yeti physics muni cz>
To: <priolof tp-srl it>
Cc: <gtk-list gnome org>
Sent: Thursday, August 16, 2012 1:56 PM
Subject: Re: gtk question.


On Thu, Aug 16, 2012 at 01:00:17PM +0200, priolof tp-srl it wrote:
Hi all this is Federico from Italy, I am working on two opensource
projects one is a debugger for Opencobol and another is a Gui for
opencobol.  Both projects  are on sourceforge and some documents are
also available at www.tp-srl.it (site of mine).

This is the question. For the GuiCobol I must define some new events
for widgets (typically GTK-Windows). In particular I need to add one
that is emitted when the form is created (first time only).

Can you be more specific what you mean by ‘created’?

There are various things that can be considered creation, with
corresponding signals, such as "realize" (see gtk_widget_realize() that
corresponds to creation of widget's window if it has one) but they can
occur repeatedly.

Connecting something to creation of the object from the outside does not
make much sense:
// Here we do not have anything to connect to.
GtkWidget *widget = gtk_window_new(...);
// Here the object has already been created.

If you want to run some code whenever an object of specific type is
created, you can *subclass* it, i.e. create some MyWindow derived from
GtkWindow and then run the code for example in the MyWindow instance
init() method.

Or, if the windows are created via some wrapper (don't know how GuiCobol
works) then this wrapper can run whatever is necessary when creating
them.

Yeti





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