Re: FG: Help Me



Linux Developer <i_am_linuxdev yahoo com> writes: 
> 1) How can I change background 
>    and foreground color
>    of label, button and columned list and
>    ofcourse other widgets.  I have tried
>    the .rc file approach and some other
>    approaches but failed.
> 
> 2) how can we change the widget colors
>    dynamically, is it possible

See http://pobox.com/~hp/gtk-colors.html

> 3) I have marked all my labels to align
>    left in glade but all label are center
>    align when the program runs, can 
>    someone help me in this

Are you setting justify left in glade instead of align left?

(Justify means relation of text lines to each other; align means 
alignment of entire text block within available space. Justify only
matters if the label contains newlines.)

If you're using align left, it must be a glade bug or something.

> 4) Can I capture the click event on a window 
>    widget if yes then how

button_press_event

> 
> 5) Can I capture the click event on a pixmap
>    widget if yes then how

Pixmap widgets don't get events normally, place the pixmap widget
inside a GtkEventBox widget then get button_press_event on the event
box.

> 6) how can I draw rectangle on a window with 
>    red color filled in it, yes I mean filled
>    rectangle

See the "scribble" example in the GTK tutorial for how to do drawing. 
A filled rectangle is gdk_draw_rectangle() with the "fill" argument
set to TRUE.

> 7) how can I change the size of font for
>    my program I need slightly small font
>    then the default font for all widgets

This is done in essentially the same way that you change colors, by
modifying the GtkRcStyle. Here using resource files is extremely
important however, because any font you hardcode will a) not exist on
all X servers and b) not work with all languages. So hardcoding a font
inherently breaks both portability and i18n. (You may not care for
your app, I'm answering the question assuming you are writing an app
for general use, if you know the 10 users of the app personally feel
free to disregard this point.)

> 8) how can I make a column list to dynamically
>    sort on column which is clicked

You have to connect to IIRC the "column_clicked" signal on GtkCList
and sort the rows yourself.

Havoc




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