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

Weird problem with gtk windows and integer incrementation



Ok here is the deal. I can not figure this 1 out.

My app can have more than 1 window open (called a form window). There is also
another window (called a toolbox window). Only 1 of the toolbox is open at all
times. I need to change the title of the toolbox window depending on which
form window has focus.
I have another variable (current_projectforms) since i use the same function
(obvously) to create a new form each time i need to, and current_projectforms
keeps up with the # of form opened. form window is GtkWidget *form_window[1000];

Ok, when i set the title, i use sprintf(form_title,"Form
%d",current_projectforms);
gtk_window_set_title(GTK_WINDOW(project_form),form_title);

What happens is, each window gets the title (every time a new one is created)
"Form 1" "Form 1 <2>" "Form 1 <3>", etc etc. Now, if i do something like
gtk_window_set_title(GTK_WINDOW(project_form),"New Form"); I don't get the <1>,
<2>, etc etc.

Another problem: the app seems to keep a new "instance" of current_projectforms
for each new window, otherwise it wouldnt do "Form 1", "Form 1 <2>", etc. But
when i echo to the exterm which form is selected, it will echo the same # each
time i click the window until a new window is created, and then it doesnt
matter what window i click on, the # remains the same in the output in the
xterm until a new window is created and current_projectforms is incremented.

current_projectforms is a global variable.



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