[Glade-users] Buttons

G'day Ishan,

I'm afraid that your experience with Microsoft Visual Basic may be
hindering your use of Glade.  The products are very different.  Although
they can generate programs that look very similar, the way they do it

You asked how to add a button widget so that clicking it makes the
program end.  Adding the button is the job of Glade.  Making it exit the
program is not.  This is the job of the program you write.

Glade is used to define the 'form' or the layout of the widgets.  The
program you write defines the 'function'.  This separation of 'form'
from 'function' during programming is good ... it lets me re-use code,
and it keeps the program easier to think about.

If I were using Glade and the C programming language, then I would do
what you ask in this sequence;

1) use Glade to
        a) define the GUI,
        b) add a callback to the button,
        b) generate the template source code,

2) use a text editor (vi, emacs, gnotepad) to
        a) edit the file src/callbacks.c
        b) add the 'exit();' function to the callback code

3) compile and run
        a) ./autogen.sh
        b) ./configure
        c) make
        d) src/programname

By the way, this method of working is not new to Glade.  Many products,
some of which predated Microsoft Visual Basic, operate in the same
manner. Professional software engineers prefer tools that save them time
in the long run, even though they may take a long time to learn first

This will make it hard for you to learn, but please persist.  Let me
know if you need any further help.

James Cameron

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