LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2002, 07:12 PM   #1
verigoth
Member
 
Registered: May 2002
Posts: 179

Rep: Reputation: Disabled
GTK toggle button to pixmap


i'm finishing up my latest project at sourceforge (http://sourceforge.net/projects/gtz [yahtzee clone]), and this last "bug" is impossible. everytime i change the pixmap (dice image) on the toggle button it tells me "Invalid cast from ToggleButton to Pixmap". normaly, the code should be similar to:
Code:
gtk_pixmap_set(GTK_PIXMAP(GTK_TOGGLE_BUTTON(button)->pixmap), ...);
but i'm using an array of structs that contain the button...so following the above example, it should look like this:
Code:
gtk_pixmap_set(GTK_PIXMAP(GTK_TOGGLE_BUTTON(dice[di-1].button)->pixmap), ...);
in that case i get the compilation error of "Invalid member: pixmap"...
this isn't an emergency situation or anything...but it would be great to get rid of it.

verigoth
 
Old 07-22-2002, 02:32 PM   #2
verigoth
Member
 
Registered: May 2002
Posts: 179

Original Poster
Rep: Reputation: Disabled
i went 'header diving' last night and found the answer (not suprisingly)...i'm just a little upset that it was not in the tutorial or any documentation. the code above is wrong. what works for ALL cases is this:
Code:
gtk_pixmap_set(GTK_PIXMAP(GTK_BIN(button)->child), ...);
or for the label of a button:
gtk_label_set_text(GTK_LABEL(GTK_BIN(button)->child), "new text");
hope this helps someone else...

verigoth
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gtk Button Events sausagejohnson Programming 0 05-26-2005 08:04 PM
gtk set button unclickable onnyloh Programming 1 08-14-2004 02:30 AM
howto get Xlibs to display pixmap? SciYro Programming 0 07-31-2004 07:11 AM
aterm -pixmap = bad option breadbin Linux - Software 2 09-25-2002 04:46 PM
GTK Button Problem krivi Programming 4 04-17-2002 04:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration