gtk-config is a normal executable, so your shell needs to find it. Thus check that after installation PATH variable points to the $prefix/bin -directory. (if you used configure without --prefix, or used prefix /usr, its very likely that the PATH and LD_LIBRARY_PATH are already corretly set)
Also there's another issue with linking applications against gtk. Your linker must be able to find gtk library. Gtk installation will place the required libraries to $prefix/lib. To fix this, you might either
g++ `gtkmm-config --cflags` -o testme1 testme1.cc `gtkmm-config --libs`For gnome--, you should use the following instead:
g++ `gnome-config gnomemm --cflags` -o testme1 testme1.cc `gnome-config gnomemm --libs`
new
.
manage()
function around that widget, like this :
Gtk_Button *my_button = new Gtk_Button("my button"); Gtk_Box box; box.add(manage(my_button));
box
will take care of deleting my_button.
gint deletion_function(Gtk_Widget *w) { delete w; return 0; } /* put the next lines inside your widget */ hide(); connect_to_function(Gtk_Main::idle(), &deletion_function, this);
// this is inside anything derived from Gtk_Widget virtual void draw_impl(GdkRectangle* r) { /* draw with low level gdk functions */ }
class myclist : public Gtk_CList { public: // override select_row virtual function void select_row(gint x ,gint y,GdkEvent* event) { // call default implementation Gtk_CList::select_row(x,y,event); // handle selecting a row here... ... } void unselect_row(gint x ,gint y,GdkEvent* event) { // call default implementation Gtk_CList::unselect_row(x,y,event); // handle selecting a row here... ... } };NOTE that select_row/unselect_row signal signature has been changed in gtk1.1 compared to 1.0 and the code needs changes to work on 1.0 gtk's.
class Entry_with_numbers_only : public Gtk_Entry { ... virtual gint key_press_event_impl(GdkEventKey* e) { gint retval; if (e->keyval<GDK_0 || e->keyval>GDK_9) { // do something, usually call virtual function // to let derived classes trap invalid key presses retval=0; } else { // do what you are doing normally. retval=Gtk_Entry::key_press_event_impl(e); } return retval; } ... };Note, It might be better to override changed_impl() method from Gtk_Entry to do this. Depends of course what you want to do. Playing with low level details is usually bad thing.
... set_events(get_events()|GDK_EXPOSURE_MASK); ...
testgtk--.C:442: sorry, not implemented: object size exceeds normal limit for virtual function table implementation, recompile all source and use -fhuge-objectsThis may happen if you're having too many widgets all declared as datamembers in one compound widget, e.g. a top level window with many widgets packed inside :
class MainWindow : public Gtk_Window { public: MainWindow(); Gtk_VBox vbox; Gtk_VBox testFixturesBox; Gtk_VBox closeButtonBox; }with each of the VBoxes containing their own share of widgets. The solution is simply to break the offending class down by replacing the datamembers with pointers :
class SmallerMainWindow : public Gtk_Window { public: MainWindow(); Gtk_VBox *vbox; Gtk_VBox *testFixturesBox; Gtk_VBox *closeButtonBox; }