where's the code for Calculator showcase? - calculator

Where can I see the code for the calculator? I mean the one with fancy background? By the way, it looks very nice!!
In general, I could not find enough material for custom-made decoration, by searching the documents. Please let me know where I can learn deeper about rendering and widget decoration.
Thanks in advance :)

You can find the source code of the calculator page in the qooxdoo SDK under
qooxdoo/application/showcase/source/class/showcase/page/theme/calc/
There is also a standalone version of the calculator on github. You can find more information about theming in the qooxdoo manual:
Theming
Appearance
Custom Themes
Decorators

Related

What is LeftNav in material-ui?

I keep seeing references to a component called "LeftNav" in the material-ui react library (example: Material UI - Open LeftNav / Drawer on AppBar click), but I can't find anything about it in the documentation. What is it? How does it differ from Drawer? Why is it apparently undocumented, despite being hugely popular (at least judging by the number of questions I see about how to use it)? What is its toggle() method for, and is there a similar method for Drawer (the documentation suggests not, but for all I would know by reading the documentation there was no such component as LeftNav at all, so I don't think the documentation can really be trusted here)?
<LeftNav/> is the same as <Drawer/>. The name was changed from "LeftNav" to "Drawer" with the release of material-UI version 0.15. Take a look at the change log here and you will see this.

How to build a flowcover in gwt?

I want to build a flowCover in GWT. But I don't know how to do it.
Have anyone an idea? Or a sample?
Greetz.
I would start with examples implementing it using CSS and see how you can copy their Javascript logic and make a similar widget: http://paulbakaus.com/2008/05/31/coverflow-anyone/ and http://scottgale.com/blog/coverflow-css-3d-transforms/2011/05/24/

Ocaml lablgtk2 custom widget?

I've been learning Ocaml with lablgtk2 for a while and still searching for a tutorial in which describe a way to create a custom widget (I want to make this widget as a circle filled with color and some text in the center). And this custom widget can be set ~width, ~height, ~label, ~packing,... to another container (as another gtk widgets can).
unfortunately, I found no tutorial about this. I read how to make custom widget in gtk2+ and try to port into Lablgtk2 but still can't help.
Can anyone help me with this issue.
Really appreciate.
I hoped that someone would prove me wrong by answering this question, but here is what I wrote in a comment:
I asked about this to one of the
co-maintainers of lablgtk2, and the
answer is that what you want to do is
not really convenient to do in
lablgtk2 and you would be better of
doing that part in C. Sorry.

Creating GTK Widget Using Expander

I am trying to create GTK Widget like shows in following Images
Is it possible to create it in GTK+ under C,
I tried using GtkExpander but it is not working out ...
Can any one Help....
Stripping the arrow is quite trivial. Just append the following code to you $HOME/.gtkrc-2.0 (or create it if not found):
style "pradeep" {
GtkExpander::expander-size = 0
GtkExpander::expander-spacing = 0
}
widget "*.GtkExpander" style "pradeep"
This is done by customizing the appearance using resource files. You can get the same result programmatically by changing the GtkExpander style properties.
Furthermore, you can connect your own callback to its "activate" signal and switch the background color of the widget whenever is active or not. And a lot more...
Just remember someone loves to have a consistent user interface.
If what you want is to duplicate the look, then there are two very inefficient solutions to the problem:
Write your own GTK theme engine (see Murrine or Clearlooks).
Replace your entire program by a GtkDrawingArea widget and use Cairo to draw exactly the look you want. You'll be on your own then, though, so you'll have to write all your widget placement algorithms, buttons, expanders, menus, and whatnot, from scratch.
GTK isn't really meant for this sort of thing. The whole point of GTK is that you design your user interface with the standard widgets, and they just work with whatever theme, language, or accessibility technologies your users need to use. If you design your own look and there's no way to change it, then someone with color blindness or poor eyesight won't be able to use it. Or the text will get all misaligned if someone uses your application in another language. Or at the very least, maybe someone just likes a black desktop with white lettering, and your application will stick out and look really ugly on that user's computer. If you really need to make it look exactly that way, then probably GTK isn't the right tool for you.

How to use GdkPixBuf?

I want to display a simple GIF image in a VBox using GTK+ from C. I know that I need to use a GdkPixbuf. But as usual there are no example of doing it. Can anyone provide help?
Also: In GTK+ how can we add a PNG image as background to a widget? Can anyone provide an example?
Forgot something to add this:
forgot to tell u that i am using Glade to develop GUI...
And i have created vBox in Glade and in one of the blocks of the vBox i need to display FIG Image....
Sorry of this...
gdk_pixbuf_new_from_file() -- but see unwind's answer for a better way to do it using a GtkImage widget.
You need to set the background pixmap field in the widget's style structure:
GtkRcStyle *newstyle = gtk_widget_get_modifier_style(widget);
newstyle->bg_pixmap_name[GTK_STATE_NORMAL] = g_strdup(pngfilename);
gtk_widget_modify_style(widget, newstyle);
PS. You can often find code examples by doing a Google search for the function you need an example of. The GTK docs usually don't contain examples for every single function, because that would clutter them up, and the documentation of functions like gdk_pixbuf_new_from_file() is usually pretty straightforward. I've noticed you often post this kind of question and I'm wondering if you are looking for the documentation in the right place. For example, are you using the excellent reference tool DevHelp? On the other hand, the GTK documentation is really missing some important information in a few places. If you have some improvements, why not contribute to the documentation?
A vbox in GTK+ is a widget, that displays other widgets as its children, stacking them vertically.
Unsurprisingly, there is a GTK+ widget dedicated to displaying images; it's called GtkImage. You should use the gtk_image_new_from_file() call to create one, passing it your GIF filename, and then just add that to your vbox. There's no need to create the underlying GDK image yourself.