Glade. Driving me up the wall

New icons and similar things are discussed here.
Post Reply
vector
Posts: 449
Joined: Sat Dec 18, 2004 11:26 pm
Location: Australia, Victoria

Glade. Driving me up the wall

Post by vector »

I seem to be having trouble with this "simple just move the mouse around" interface tool.

I though i would have a play jsut to try and learn a few things and got no where.

I inserted a new button between preview and figures by:
selecting figures
right click
hbox1
insert before
the grey checkerd box it now presents I placed a button within.
I carefully manually copied the contents/properties of (the bottom right table button) so I now had two buttons that would allow me to show the table. All looked fine but..
when compiled and bygfoot is run I now have just a grey main window with nothing in it.

I tried various other ways of adding buttons or deleting buttons but got hopelesly lost with compile errors or just no windows in the actuall game.

I guess ill sleep on it and see what gives tomorrow. But glade does not seem that clever. Compared to visual basic I remember using once.
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Post by gyboth »

that's weird. are you using glade 2.0.x? 'cause 2.6 is for gtk 2.6, and Bygfoot uses gtk 2.4 or so; though this should not be a problem here.
when i want to add a button, i select the hbox or vbox it should be in, increase the size of the box (which adds a placeholder at the end), and add a new button there. then i select it and choose it's place within the box (in the second tab of the properties window). you can also copy an existing button by selecting and 'copy and paste' (i think); of course the widget name doesn't get copied, that'd lead to compilation errors.

why don't you just live next door... or at least in the same time zone ;-)

gyözö
Press any key to continue or any other key to quit.
vector
Posts: 449
Joined: Sat Dec 18, 2004 11:26 pm
Location: Australia, Victoria

Post by vector »

ohh dear
problem elsewhere.
I had copied bygfoot.glade and then played with the original and when it broke I simply renamed the copy back to bygfoot.glade, opened it with glade and built it and then ran make etc. thinking that should fixx all. but some wierd error crept in somehow.

Even deleting bygfoot.glade and cvs up a new one did not fix the make error.

I ended up deleting the unstable dir, a new cvs up and bingo back in business.

Added a button like you said and it worked first time.
Man I wasted half the afternoon on that :oops:

me thinks gyboth is now scared he has given me cvs write accesss

wwwwwooooahhahahahhhah

dont worry i test a clean make and run bygfoot and play 2 seasons b4 I cvs commit. :?
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
vector
Posts: 449
Joined: Sat Dec 18, 2004 11:26 pm
Location: Australia, Victoria

Post by vector »

Still crazy
All im trying to do is put/move the tables and fixtures buttons from the bottom of the main window up to the top, in between preview and figures.

as you sugested i made a new position in hbox
I placed a button there
I modified the properties to mirror the fixtures button
also moving it to position 11

I save, build
make
and get this error
-Wall -g -O2 -c callbacks.c
callbacks.c:974: error: redefinition of `on_button_fixtures_clicked'
callbacks.c:761: error: `on_button_fixtures_clicked' previously defined here
make[2]: *** [callbacks.o] Error 1
I think a previous attempt at copy and paste the fixtures button may have worked. But when I tried to copy paste the tables button it made a grey screen. I looked deeper using widget tree and noticed the bottom buttons had lots of hbox and vbox and alignment things hanging of them so I decided I would opt for making the button from scratch so it was clean but that lead to the problem above

the above error lead me to think it was because I had two copies of the buttons (my new and the original ) But deleting the original did not help.

there is some glade subtlety Im missing?

BTW my full implementation will be to:
move figures drop down menu box to just above the league fixtures box(you currently have a hidden label there)
and remove the fixtures and table buttons from the figures menu.
and remove the original fixtures table buttons (the ones on the bottom row)

The space gained by moving figures will be used by the new fixtures and table buttons.
its just a rearrangment. it may or may not work
I wanted to play a few week like this to see how it goes.
the new figures menu would only contain best players,and history.. which is rarely used and thus can live down the bottom

I do not intend on cvs uping this untill you have had a play as it is a fair change.
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Post by gyboth »

vector wrote:I think a previous attempt at copy and paste the fixtures button may have worked. But when I tried to copy paste the tables button it made a grey screen. I looked deeper using widget tree and noticed the bottom buttons had lots of hbox and vbox and alignment things hanging of them so I decided I would opt for making the button from scratch so it was clean but that lead to the problem above

the above error lead me to think it was because I had two copies of the buttons (my new and the original ) But deleting the original did not help.

there is some glade subtlety Im missing?
yes. two, in fact. the first: copy and paste doesn't work well via keyboard shortcuts. don't ever use the keyboard (Ctrl-C and -V etc.) to cut, copy and paste in glade. use only the mouse (and when copying widgets, use the widget context menu). it's annoying and i hope damon chaplin will fix it some day.

second subtlety: when you make a new button and add callback functions for it in the properties window, glade adds empty function definitions to the files 'callbacks.c' and 'callbacks.h'; but it doesn't check whether there are already functions with the same name, they just get appended.
now, if you make a new button with the same callback funcs as an already existing one (which is what you did), there'll be two functions with the same name etc. in the c and h file. this is what the error message is about; it's not allowed to have such a duplicity.
so what you have to do in such a case is, open the callbacks.c and callbacks.h files (or their equivalents if you're working on another glade file, eg. misc_callbacks.c and .h) and delete those empty functions that glade has appended. then everything should work fine.
even better is to use cut and paste to move the button to a new place. no new functions will be created this way.
BTW my full implementation will be to:
move figures drop down menu box to just above the league fixtures box(you currently have a hidden label there)
and remove the fixtures and table buttons from the figures menu.
and remove the original fixtures table buttons (the ones on the bottom row)
i've been thinking to use the menu more heavily (your idea, wasn't it?). move 'figures' to the menu bar, as well as 'options' and quick-opts. but i won't tackle it for a time, i think. let's see what you accomplish.
I do not intend on cvs uping this untill you have had a play as it is a fair change.
i don't know, the cvs can be a playground all right. as long as the game is playable, why not try things out there? if it's only the appearance, upload away :-)

gyözö
Press any key to continue or any other key to quit.
vector
Posts: 449
Joined: Sat Dec 18, 2004 11:26 pm
Location: Australia, Victoria

interface of grey

Post by vector »

After much changing one thing re-making and and testing, the problem actually comes down to the original fixtures buttons on the bottom row.

I thought the safest approach was to delete the buttons and place a label in its place to keep the spacing the same.

Something in the deletion however causes the "interface of grey" error to appear. The error causes a complete blank grey main window to appear when bygfoot is run.

I now have delted the image and hbox.
leaving the button_fixtures and alignment13

original button_tables and alignment12 were deleted completly without problems a blank label in its place

this leaves one small square in the final interface (which still works) where the original fixtures would have been.

No matter what I try I seem to end up with the interface of grey if I rename this button to anything other than "buttons_fixtures" or of course remove it alltogether.

the new buttons (top row now) of fixtures and tables work fine.
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Re: interface of grey

Post by gyboth »

i don't have a clue, unfortunately :-? i never had such severe problems with glade. maybe you could just send me / post your current glade file.

and you could also post a screenshot what it looks like now :-)

gyözö
Press any key to continue or any other key to quit.
vector
Posts: 449
Joined: Sat Dec 18, 2004 11:26 pm
Location: Australia, Victoria

Post by vector »

Ill do that. I think all you need is the bygfoot.glade
so ill send that .
ill explain a bit more in the email


But i dont want to take you away from 1.9
:evil:
"There are two ways to score. Dribble it over the line or smash it into the back of the net."
What type are you?
gyboth
Site Admin
Posts: 1421
Joined: Sat Dec 18, 2004 8:42 am
Location: Passau, Germany
Contact:

Post by gyboth »

vector wrote:Ill do that. I think all you need is the bygfoot.glade
so ill send that .
erm.. i missed some pixmaps, too. but never mind, because i've decided to let cvs and the 1.7 interface be for a while, because
  1. i don't have internet on the computer i'm using currently for programming (and running linux)
  2. the hardware is rather old, so it takes 45 or 60 seconds to recompile the game when i change the interface files.
i don't have the patience for that :-? i'll help you in a week, when i'm home and using my good old 2GHz-computer ;-)

gyözö
Press any key to continue or any other key to quit.
Post Reply