How to use an image as a button in GTK? - c

How to use an image as a button in GTK in c language in code blocks? I have tried making the button of same color as that of the background and then adding image on it. But there is a outline or shadow still there. So, how can i remove those shadows or is there a way to directly use an image as a button?

One way is outlined by #Shabhaz, by putting the image in an EventBox, and handling the button-press event.
The other way is by placing the image in the button and customizing the style of the button to remove the outline and the shadow. You would call gtk_rc_parse_string() to define an outline-less button class, and gtk_widget_set_name() on your button to apply the style.

Related

Focus frame on buttons Material-UI v.1.0.0

I changed the version of the library to v1.0.0-beta.21 from v.0.19
And now all buttons have a focus frame. For example
First
Second
How can I hide this frame?
Using css, something like button:focus {outline:0;} should work. Although you should consider re-styling the outline rather than hiding it for the sake of accessibility.

Set focus on image by default

I use the froala editor. (using angular).
I want that the first image get focus on initialize.
When I open the editor I get the editor without focus
And I want it to be with the image toolbar
What I need to write in the "froalaEditor.initialized" event for focusing the first image
Thanks!

ng-class removes a class but does not put it back

In angular.js, I'm trying to apply a set of classes based on the value of a variable on $scope. But when I set a pair of space-delimited classes, ng-class seems to be removing any that are already present (and it doesn't put them back).
See the Fiddle here: http://jsfiddle.net/fLf0fenj/
Try clicking any of the gray buttons. An icon will appear. It's one from Font Awesome, and the class is fa fa-whatever. Now click another of the gray buttons. The icon should turn into another Font Awesome icon, but instead of that element having two classes (fa fa-something-else), it just has the fa-something-else, so it looks like a square.
If you instead click a gray button, and then the green button, it's all fine. Because that green button uses a glyphicons icon, and so the class names are all being switched out each time.
How do I get around this behavior?
Try
ng-class="statusIcon()"
And here's a working fiddle

CodeNameOne: Custom dialog theme issue

How can I create a theme for a dialog box?
I was trying to change the border style of the dialog box but the border style applies 2 times for an inner element and for an outer element. I was expected that the border style applies only to the inner element.
To be clearer, as I cannot add image to my post, it seems that the dialog does not consist only from the center box which is showed while dialog is active. The dialog UI consists from a “background form” which usually is transparent and from a container which overlay over the background form. The last mentioned container contains de graphic representation of the “dialog box”.
My issue is that I can not apply my style only to the container which contains the dialog box but the style applies also to the background form.
How can I apply the border style only to the dialog box container element?
Any additional tips will be highly appreciated.
Thanks.
How are you applying the style? Are you using the theme to apply a style to the Dialog UIID as explained here.
Using setStyle or getStyle on a dialog component would be problematic and would not result in proper styling (you might get away with doing it on getDialogComponent but you should work with the theme).
Notice that to style a dialog you should use Dialog, DialogTitle & DialogBody UIID's and quite a few theme constants.
Thanks Shai,
is clear now.
I’m doing a custom dialog starting from the BlankDialog element provided in designer.
Because I started from BlankDialog I thought that overriding only UIID theme is enough.
I understood the BlankDialog structure wrongly thinking that is a simple empty form because is named "Blank…"
Is clear now that for every new UI object added, I should check if it has any other UI child to be customized together with the parent.
Thanks again.

create a popover programatically without border

I need to create a popover Programatically like the image showed below
The Problem I'm facing is while creating the popover it comes with default border.
is there any way to create the Popover without border.
There is no direct way to remove the popover border. You can try something suggested here

Resources