Re: [gtk-list] Re: Need help on Gtk--
- From: Chowdhury Takdir Hossain <takdir dblab is tsukuba ac jp>
- To: gtk-list redhat com, kenelson ece ucdavis edu
- Subject: Re: [gtk-list] Re: Need help on Gtk--
- Date: Thu, 17 Dec 1998 05:04:09 +0900
From: Karl Nelson <kenelson@ece.ucdavis.edu>
Subject: [gtk-list] Re: Need help on Gtk--
Date: Wed, 16 Dec 1998 11:34:37 -0800
> Can you send a little more of the source code. It is not apparent
> what is the declarations of function system. It looks like a template
> problem as connect_to_function is a template. (I haven't worked
> with gcc 2.8.1, so I don't know how well the templates are supported.)
> Additionally some casting may be required for that callback argument
> you placed.
>
> Most of the gtk-- testing is done with egcs. So there may be some differences
> there.
Thanks Karl for your prompt reply.
I am sending you the whole source code. Hope this will give you a hint. I
will buy you a drink if my program runs:-) You see I have spent almost 2 days with his troublesome program.
#include <gtk--.h>
#include<stdlib.h>
class Launcher:public Gtk_Window
{
public:
Launcher();
gint delete_event_impl(GdkEventAny*){
Gtk_Main::instance()->quit();
return 0;
}
private:
Gtk_VBox* vbox;
};
Launcher::Launcher()
{
vbox = new Gtk_VBox();
add(vbox);
vbox->show();
Gtk_Button* button;
button = new Gtk_Button("Kterm");
vbox->pack_start(button);
connect_to_function(button->clicked,&system,"kterm &");
button->show();
button = new Gtk_Button("Netscape");
vbox->pack_start(button);
connect_to_method(button->clicked, Gtk_Main::instance(), &Gtk_Main::quit);
button->show();
}
int main(int argc, char **argv)
{
Gtk_Main m(&argc, &argv);
Launcher l;
l.set_title("My Launcher");
l.show();
m.run();
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]