RE: [gtk-list] Re: gtk-- : What's wrong with this code...?




On 03-May-98 Guillaume Laurent wrote:
> Jonathan Belson <jon@dookie.demon.co.uk> writes:
> 
>>         GSList *gsl = new GSList
> 
> No need to call 'new' on this one. It's not a class anyway.

AIUI a struct is a type of class in C++, but since there is no
constructor I'd agree that calling 'new' is kind of pointless 8^)

>> Any clues?
> 
> You do a b1->show(), do you ?

Yes.

> Anyway, this works fine here :
> 
> class RBTest : public Gtk_Window {
> public:
>   Gtk_HBox *b1;
>   
>   Gtk_RadioButton *render_type1;
>   
>   RBTest(void);
>   
> };
> 
> RBTest::RBTest(void) {
>   
>   GSList *gsl; // = new GSList;
>   
>   show();
> 
>   b1 = new Gtk_HBox(false, 0);
> 
>   add(b1);
> 
>   b1->show();
> 
>   render_type1 = new Gtk_RadioButton(NULL, "One");
>   b1->pack_start(render_type1, TRUE, TRUE, 0);
>   render_type1->show();
> 
>   render_type1 = new Gtk_RadioButton(render_type1->group(), "Two");
>   b1->pack_start(render_type1, TRUE, TRUE, 0);
>   render_type1->show();
> 
>   render_type1 = new Gtk_RadioButton(render_type1->group(), "Three");
>   b1->pack_start(render_type1, TRUE, TRUE, 0);
>   render_type1->show();
> 
> }


Using this code I get something similar to what I had before, namely three
buttons that are more or less independent, ie. they can all be pressed down
but they stay down and won't come up again.

If I connect_to_member() after creating the third button then only the third
button calls the callback (only once, since it stays down when clicked).

Maybe there's something wrong with my installation?  I'm using gtkmm 0.9.1
and gtk 1.0.0.

C-YA
Jon

http://www.dookie.demon.co.uk



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