Change Text Color for Gtktoggletoolbutton in C Code (Gtk+3)

Change text color for GtkToggleToolButton with CSS sheet (GTK+3)

You might try changing the color of the label rather than that of the button. Buttons are really just clickable bins. Buttons with text are just a helpful constructor which automatically adds a label.

#histoToolGreen label {
color: green;
}

#histoToolBlue label {
color: blue;
}

Mono fonts for all GtkTextView with CSS file with GTK+ 3.20

GTK 3.20 changed the way that CSS selectors work.

Pre-GTK 3.20, this was correct:

GtkTextView {
font-family: monospace;
}

Starting with GTK 3.20, this is correct:

textview {
font-family: monospace;
}

If you're not sure about a particular platform, you can check with the GTK Inspector what selector is needed: run your app with GTK_DEBUG=interactive and press Ctrl+Shift+D.

It's worth noting that the pre-GTK 3.20 CSS selectors were experimental and not intended to be stable API.

If you have to support both forms, then your best bet is probably to make two stylesheets and load one or the other depending on the value of GTK_MAJOR_VERSION and GTK_MINOR_VERSION.

gtk_events_pending() returns FALSE with events still pending

Try g_main_context_pending(NULL) and g_main_context_iteration(NULL,FALSE) instead of gtk_events_pending(), the later is deprecated.


It could be a timing issue that kicks in (it oculd be that your loop kicks in before any events are registered to the mainloop, and thus instantly exits) - but this is just wild guessing due to lack of code.


The break condition is also wrong, you do not want to exit as soon as all events are processed at a specific point of time, you want to continue until long-run-ops are done.
That means you need to signal when your operation is done, check that flag in the loop you currently use and use blocking mode of the *_iteration(...)



Related Topics



Leave a reply



Submit