Find the answer to your Linux question:
Results 1 to 3 of 3
hi all i am doing gtk application (gui) for this am using gtkrc file.. in my gtk application, there are 4 buttons so i included pixmap in gtkrc file... but ...
  1. #1
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247

    gtk question

    hi all
    i am doing gtk application (gui)
    for this am using gtkrc file..

    in my gtk application, there are 4 buttons
    so i included pixmap in gtkrc file...

    but all the four button getting the pixmap..
    i would like to use deferent pixmaps to each button..

    is it poosible

    please help me

    thank you in advance
    "Relationships are built on trust and communication"

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    You don't make it clear whether you are actually writing this program yourself. If you are, why not just create four pixmaps and put each one on its appropriate button using the gtk_container_add function?
    "I'm just a little old lady; don't try to dazzle me with jargon!"

  3. #3
    Linux Newbie
    Join Date
    Feb 2007
    Location
    hyderabad, india
    Posts
    247
    Quote Originally Posted by hazel View Post
    You don't make it clear whether you are actually writing this program yourself. If you are, why not just create four pixmaps and put each one on its appropriate button using the gtk_container_add function?
    yes u r correct...
    but.. there is a problem with gtk container add.
    there are 4 stages to the button.
    NORMAL
    ACTIVE
    PRELIGHT
    INSENSITIVE
    if we add pixmap directly to the button
    in the above cases the button fails to show the pixmap

    so that i used gtkrc file...
    style "button"
    {
    #bg[NORMAL] = "#909090"

    engine "pixmap"
    {
    image
    {
    function = BOX
    recolorable = TRUE
    state = NORMAL
    detail = "pixmaps/butt.png"
    shadow = IN
    file = "pixmaps/butt.png"
    border = { 9, 9, 9, 9 }
    stretch = TRUE
    }
    image
    {
    function = BOX
    recolorable = TRUE
    state = NORMAL
    shadow = OUT
    file = "pixmaps/butt.png"
    border = { 3, 3, 3, 3 }
    stretch = TRUE
    }
    image
    {
    function = BOX
    recolorable = TRUE
    state = PRELIGHT
    shadow = OUT
    file = "pixmaps/butt.png"
    border = { 3, 3, 3, 3 }
    stretch = TRUE
    }
    image
    {
    function = BOX
    recolorable = TRUE
    state = NORMAL
    shadow = IN
    file = "pixmaps/butt.png"
    border = { 2, 2, 2, 2 }
    stretch = TRUE
    }
    image
    {
    function = BOX
    recolorable = TRUE
    state = INSENSITIVE
    shadow = IN
    file = "pixmaps/butt.png"
    border = { 3, 3, 3, 3 }
    stretch = TRUE
    }
    image
    {
    function = BOX
    recolorable = TRUE
    state = INSENSITIVE
    shadow = OUT
    file = "pixmaps/butt.png"
    border = { 3, 3, 3, 3 }
    stretch = TRUE
    }
    image
    {
    function = BOX
    recolorable = TRUE
    state = SELECTED
    shadow = IN
    file = "pixmaps/butt.png"
    border = { 3, 3, 3, 3 }
    stretch = TRUE
    }
    image
    {
    function = BOX
    recolorable = TRUE
    state = ACTIVE
    shadow = IN
    file = "pixmaps/butt.png"
    border = { 3, 3, 3, 3 }
    stretch = TRUE
    }
    }
    }
    class "GtkButton" style "button"
    in this case all the buttons of the widget shows "butt.png" only...
    my question is
    i would like to show deferent pixmaps to the deferent buttons..

    please help me
    thank you in advance
    "Relationships are built on trust and communication"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...