button is focused by default in GTK+2

I have created some buttons in GTK, but I want to prevent every button to be focused by default, and for that I have used gtk_widget_set_can_default(GTK_BUTTON(button[row][col]), FALSE); but even then the first button button[0][0] is focused when I run my code. So how can I prevent it from being focused?

code:

table = gtk_table_new(10, 10, TRUE);  for (int row=0; row<10; row++) {     for (int col=0; col<10; col++) {         button[row][col] = gtk_button_new_with_label(" ");         g_signal_connect(G_OBJECT(button[row][col]), "button-release-event", G_CALLBACK(buttonClicked), NULL);         gtk_button_set_focus_on_click(GTK_BUTTON(button[row][col]), FALSE);         gtk_widget_set_can_default(GTK_BUTTON(button[row][col]), FALSE);         gtk_table_attach_defaults(GTK_TABLE(table), button[row][col], col, col+1, row, row+1);     } } 

Replay

Category: c# Time: 2016-07-29 Views: 0
Tags: gtk2

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.102 (s). 12 q(s)