c++ - GTK : Any way to mximize the window on Button trigger -


is there callback function, when click button window maximizes. way i'm using gtk 3.0 , c++ (not gtkmm). wrote function called during button click event , put line

int maximise(){ gtk_window_fullscreen(gtk_window(window)); } 

it gets compiled, while click button program terminates showing segmentation fault. (this function inside class)

check whether callback called using i.e. g_print

make sure signal correctly connected button

g_signal_connect (button, "clicked",               g_callback (maximise), null); 

and window gtkwidget * type

note written gtkbutton reference callback have that:

void user_function (gtkbutton *button, gpointer user_data) 

and have type of callback int

for me both versions (with int , void callback works)


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -