Re: can get help with this?.



On Sun, 14 Nov 1999, * * wrote:

> Hi,
> I tied to run the progress bar program  that you see in below. I get 
> warnings/errors like
> "implicit decalaration of UpdateProgress" and  "undefined reference to 
> UpdateProgress".
> Cold you , take a  look and see what is wrong?. I have tried everything. I 
> like to
> know what might be the error. I have put "gint and int" before the 
> UpdateProgressTimer.

Short notes: Use ANSI C prototypes. Use indentation (indent(1) is your
friend). Don't make typos. Don't confuse function names.

> 
> 
> #include <gtk/gtk.h>
> int ptimer;
> int nValue;
> UpdateProgressTimer (gpointer data)
 ^                    ^^^^^^^^^^^^^^^
void                  Huh? I don't know if this signature is correct...

> {
> nValue += 1;
> UpdatePrgress (nValue, 100);

This should be called UpdateProgress, I think. I can not see
UpdateProgress() anywhere in this listing.

> if (nValue == 100) {
>   EndPorgress ();

EndProgress, same here.

>   gtk_timeout_remove (ptimer);
> }
> }
> gint ButtonClicked (GtkWidget *widget, gpointer data)
  ^^^^
  void

> {
> nValue = 0;
> StartProgress ();
> ptimer  = gtk_timeout_add (100, UpdateProgressTimer, data);
> }
> gint CloseAppWindow ()
                      ^^
                      GtkWidget *w, GdkEvent *event, gpointer data

> {
> gtk_main_quit ();
> return (FALSE);
> }
> main (int argc, char *argv[])
^^
int

> {
> GtkWidget *window;
> GtkWidget *button;
> gtk_init (&argc, &argv);
> window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title (GTK_WINDOW (window), "Progess bar");
> gtk_signal_connect (GTK_OBJECT (window), "delete_event",
>                              GTK_SIGNAL_FUNC (CloseAppWindow), NULL);
> button = gtk_button_new_with_label ("Progress bar");
> gtk_widget_show (button);
> gtk_signal_connect (GTK_OBJECT (button) , "clicked",
>                              GTK_SIGNAL_FUNC (ButtonClicked), NULL);
> gtk_container_add (GTK_CONTAINER (window), button);
> gtk_widget_show (window);
> gtk_main ();
> exit (0);

You could even just return(0).

> }

Nils
-- 
Nils Philippsen / Vogelsangstrasse 115 / D-70197 Stuttgart / +49.711.6599405
nils@wombat.dialup.fht-esslingen.de / nils@fht-esslingen.de / nils@redhat.de
   The use of COBOL cripples the mind; its teaching should, therefore, be
   regarded as a criminal offence.                  -- Edsger W. Dijkstra



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