Re: Dynamic Dialog generation

Bob Wilkinson wrote:

Oops, I think that you've misunderstood my example. 

I wanted to be able 
to enter any (integral) number into the input box, and have the facility 
to set any of the checkboxes (in the real example I have 9). Dependent 
on the state of the checkboxes, I 'd like to (when set) provide a new 
input box for the user to be able to enter data. So if 3 of the 9
checkboxes were set, I'd like to put input boxes in sets of 3 on the 
next dialog.

I can do all of this statically by providing sets of 9 input boxes, but 
if I know that they're unnecessary, it saves me a lot of hitting the 
tab key, by not displaying them.

I would like the number of sets of input boxes to be governed by the 
number entered into the first dialog.
Have you looked at $widget->hide() as a solution. I reckon that if you 
build a dialog with 9 input boxes with predictable names you can then do


in a loop in the signal handler that constructs or raises the dialog. If
you are reusing the dialog you may need to call 


to make them visible again.
I notice in your code unmodified, readonly: line 146 of 1004 [14%]
I have tried to add handlers from within Glade for dialogs, but have 
received warnings. Why is this restriction there, if I can add them
You will also notice that the sub is called frig_Gnome_Dialog_buttons() :)
and was added because there was a mismatch between the way that Glade
stores the buttons/labels and the way that Gnome constructs them. You can
not access the buttons until they are automagically constructed so to add
accelerators and connect signals you need two passes through the Glade
widget structure or do it the way that Glade-Perl does it.

I will have another look at it to see if I can make it simpler or if
Gtk-Perl has some newer methods to achieve the same thing. Thanks for
pointing it out.

I have been using Glade and your Perl interface. I think that I would be
able to use the Gtk Perl interface to effect what I'd like to do, but I was
curious as to how this should be done from within the Glade paradigm.
I hope that I am nearer this time. Please let me know how you get on - it
is a great help to me to know what people are really developing.

Regards, Dermot

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