Re: help_focusRectangle



Hi Ashok,

One possible solution is to use a theme the already provides it ( draw
a yellow rectangle around above the focused widget) or customize one.
I can not give you more details , because i've never did anything
related ... i did implement just switches between application themes
using existing themes :((

Probably there is another solutions ... if somebody gives it a shot ;)

best regards

On 5/2/05, Ashok jain <mrec123 ashok gmail com> wrote:
I have created a widget by using gtk APIs like this:

//Window creation
setupmenu_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_object_set_data (GTK_OBJECT (setupmenu_window),
"setupmenu_window", setupmenu_window);
gtk_widget_set_usize (setupmenu_window, WIN_WIDTH, WIN_HEIGHT);
GTK_WIDGET_SET_FLAGS (setupmenu_window, GTK_CAN_FOCUS);
gtk_window_set_title (GTK_WINDOW (setupmenu_window), _("Setup Menu"));

//Fixed window
setupmenu_fixed = gtk_fixed_new ();
gtk_widget_ref (setupmenu_fixed);
gtk_object_set_data_full (GTK_OBJECT (setupmenu_window),
"setupmenu_fixed", setupmenu_fixed,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (setupmenu_fixed);
gtk_container_add (GTK_CONTAINER (setupmenu_window), setupmenu_fixed);
gtk_widget_set_uposition (setupmenu_fixed, 0, 0);
gtk_widget_set_usize (setupmenu_fixed, WIN_WIDTH, WIN_HEIGHT);
GTK_WIDGET_SET_FLAGS (setupmenu_fixed, GTK_CAN_FOCUS);

//Label widget creation

mcolor_label = gtk_label_new (_("Matte color"));
gtk_label_set_font(GTK_LABEL(mcolor_label), FONTTYPE1);
gtk_label_set_txtColor(GTK_LABEL(mcolor_label),label_disable_color1.pixel,
label_disable_color1.red,label_disable_color1.green,
label_disable_color1.blue);
gtk_label_set_bgColor(GTK_LABEL(mcolor_label),highlight_bg_color.pixel,
highlight_bg_color.red,highlight_bg_color.green, highlight_bg_color.blue);
gtk_widget_ref (mcolor_label);
gtk_object_set_data_full (GTK_OBJECT (setupmenu_window),"mcolor_label",
mcolor_label, (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (mcolor_label);
gtk_fixed_put (GTK_FIXED (setupmenu_fixed),
mcolor_label,SETUP_RIGHT_LABEL_POSX, SETUP_RIGHT_LABEL1_POSY);
gtk_widget_set_uposition (mcolor_label,
SETUP_RIGHT_LABEL_POSX,SETUP_RIGHT_LABEL1_POSY);
gtk_widget_set_usize (mcolor_label,
SETUP_RIGHT_LABEL_WIDTH,SETUP_RIGHT_LABEL_HEIGHT);
gtk_label_set_alpha(GTK_LABEL(mcolor_label),255);
gtk_misc_set_alignment (GTK_MISC (mcolor_label), 0.08, 0.57/RATIO);

*How can I get a yellow rectangle around above label if I focus that?*
*Plz reply ASAP.*

**
*Regards*
*Ashok Jain*
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



-- 
Antonio Gomes
E-mail: antonio gomes indt org br
Embedded Linux Lab - 10LE
INdT - Instituto Nokia de Tecnologia (Manaus/Br)
NOKIA's Technology Institute



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