in the previous video we created a small
window with a button in it and there's
the button may I help you and when you
click it it will bring up or alter the
contents of this label the label has
nothing in it so you don't normally see
it unless you click on it but up here is
what I want to briefly work on is the
content of the button it's got text in
it you don't have much in the way of
flexibility it's just going to be text
there is a way of going in there and
modifying the CSS so that you can change
the font and so forth but if you do that
you also conflict with the underlying
theme of your genome desktop so probably
not desirable what a lot of people like
to do of course is put icons in here now
we can do that if we go over here to the
right hand side and say add custom
content
well actually stock button is where I
wanted to go first stock button if you
go to start button there is a bunch of
buttons there and I don't know let's
let's just pick the one with floppy and
you get the word floppy which is not
really much of an improvement it
actually has less buffer space if you
might notice on the edges which is odd
but that's the way it works and you have
some left right type of justification of
it you could say always show image now
you're gonna get the word floppy with
the word with an image of the floppy
icon I don't know if that's really much
of an improvement what I'd like is just
to have an icon in there whether it's a
stock icon and you saw there was a list
of stock icons here or if it's one I
designed myself which is just a small
JPEG or dot PNG file okay so I say add
custom content now I want to add custom
content you notice we have this grayish
area in here there's nothing in there it
is an area however into which I can put
something because this is a container of
sorts the button now becomes a container
and what I would like to do is I'd like
to put an image in there so I go to gtk
image and I drag it and I put it in
there now what you're seeing there is
gtk
missing image I'm sorry it's very tiny
it's not really visible at all but it's
the gtk Stockham image for a missing
image
it's button size you can pick other
sizes like about dialogue and there's
it's much larger now we're gonna have to
adjust some sizes here but if I want to
put a stock icon in there for example
let me go to floppy again there it is
there is the floppy now I would go over
here and I would let's see that's the IQ
gotta watch out because you get the
button and then the child of the button
is the image I did not give the image a
name you don't really need till you're
probably not going to play with the
image you might you may want to make the
image invisible and have another image
that comes up in place of it in which
case you'll need an ID for it but the
button is the controlling item here and
the button has a size parameter so I
guess that's as big as it's going to be
I guess there's nothing to be changed
there that's the size it wants to go but
there is the there is an image inside of
the of the button now if I were to save
this which I just did and if I would go
to my excuse me let me bring up the
there it is
if I go here and I run the program the
program is still the same Park Won - BIM
because I didn't change the program all
I did was changed the XML file and you
see now you don't get text in there you
get an image the image is totally
irrelevant to what the button is doing
but now you get the idea you can not
only put stock images in there you could
put images that you created yourself so
if I click here you'll see there's my
hello world pops up like before so I
kill that and go back out the in terms
of the in terms of the actual image down
here it is using a stock ID you could go
and if you click on this button down you
could go to a file name and you could
actually access a file name
of your own creation and it would go in
there instead of the image every time
you do this of course it loses its mind
it forgets everything and so you've got
various sizes
it's a drag-and-drop size there's a
button size which is pretty tiny large
toolbar size small tube toolbar size
menu size and I didn't know much see
dialogue sighs I guess is one of the
larger ones you don't have too much
control over it altogether but anyway
there's the there's the way you can put
an icon inside of a button and go with
that